I want to get the IP for the requested service. I can successfully get the ip by using
But the ip can be changed by passing a header
X-Forwarded-For: <dummy ip> .
This is the test that I did. I can add any value on that header and it will return that value. (The IP is the photo is just a dummy IP.)
After looking at source code I see that
frappe.get_request_header('X-Forwarded-For') is used to get the ip.
Now, when I call this without
X-Forwarded-For it returns my real IP.
But if I pass
X-Forwarded-For as a header it returns the dummy AND my real IP separated by comma where the Real IP is in the end.
I think this should be fixed IF
frappe.get_request_header('X-Forwarded-For') returns the real IP in the end.