Associated revisions

lib/webrick/httprequest.rb (setup_forwarded_info): Parsing request
header failed when the request is from 2 or more Apache reverse
proxies. It's said that all X-Forwarded-* headers will contain more
than one (comma-separated) value if the original request already
contained one of these headers. Since we could use these values as
Host header, we choose the initial(first) value. See #4922.

lib/webrick/httprequest.rb (setup_forwarded_info): Parsing request
header failed when the request is from 2 or more Apache reverse
proxies. It's said that all X-Forwarded-* headers will contain more
than one (comma-separated) value if the original request already
contained one of these headers. Since we could use these values as
Host header, we choose the initial(first) value. See #4922.

test/webrick/test_httprequest.rb (test_forwarded): Test it.

History

Be careful when using these headers on the origin server, since they will contain more than one (comma-separated)
value if the original request already contained one of these headers. For example, you can use %{X-Forwarded-For}i
in the log format string of the origin server to log the original clients IP address, but you may get more than one
address if the request passes through several proxies.