PerlDancer / Dancer

The easiest way to write web applications with Perl (Perl web micro-framework)
http://perldancer.org/
740 stars 211 forks source link

request->address can return multiple IP addresses #1235

Open ichesnokov opened 1 year ago

ichesnokov commented 1 year ago

When behind_proxy is on, request->address returns value of X-Forwarded-For header, and it's completely legitimate for this header to contain multiple IP addresses: https://developer.mozilla.org/ru/docs/Web/HTTP/Headers/X-Forwarded-For - IP of the client and proxies' IPs.

While according to Dancer documentation it should only Return the IP address of the client.

It would be nice to make it only return client's IP - either first IP from the list, or $ENV{REMOTE_ADDR} (like e.g. Dancer2 does).