Bug in HTTPRequestHandler GetIP method?
We want to use Cloud Armor as an extra protection layer for the e-martketplace build with OutSystsmes. Cloud Armor is a well-known product from Google to deliver this functionality.
The setup isClient browser -> Clour Armor load balancer -> OS load balancer -> 4 front-end servers
We use the standard HTTPRequestHandler GetIP API from OutSystems to get the IP address from the client. This works fine until we place Cloud Armor in the network pipeline.
I have created a test page which shows the IP address returned by GetIP and all the IP addresses in the header X-Forward-For.
The result is something like, where in my case 178.xx.xx.xxx is my home IP address:
X-Forwarded-For: 178.xx.xx.xxx,34.110.183.233, 34.127.199.199GetIP: 34.127.199.199
The GetIP method returns the last IP address (which is from the Cloud Armor setup) instead of the IP address of the client.
Is this a bug? How can we get the correct IP address using GetIP from HTTPRequestHandler or do we have to write our own GetIP method that picks the first IP address instead of the last one?Kind regards,Johan den Ouden
Hello Johan.
I just wanted to share that I came across the same situation with a different service and I ended up writing my own method like you described.
I'm not sure if this is intended but lets see if someone can clarify it for us
Hi @Johan den Ouden ,I also face the same thing and I think that's the behaviour of GetIP, it will get the last IP that reach out to OutSystems LB. So that I use this method to get the IP from user and it worked for me:
Hope this helps.