If we trust a proxy we should use last IP address from X-Forwarded-For.
We shouldn't check IP address from X-Forwarded-For is trusted or not, but some validation is required.
Also, I think we should change value from X-Forwarded-For, after applied new IP address.
For example 127.0.0.1 is trusted proxy,
Roadrunner received request
https://github.com/spiral/roadrunner/blob/master/service/http/handler.go#L149
Hello, I think I found some a bug.
If we trust a proxy we should use last IP address from X-Forwarded-For. We shouldn't check IP address from X-Forwarded-For is trusted or not, but some validation is required.
Also, I think we should change value from X-Forwarded-For, after applied new IP address.
For example 127.0.0.1 is trusted proxy, Roadrunner received request
Then roadrunner should send next request
If X-Forwarded-For has only one IP Address, we should remove that header. For example
Received request
Should to send without X-Forwarded-For
About X-Forwarded-For https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For Correct example https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/HttpFoundation/Request.php#L790
P.S. I just php developer, so can not fix it