openvsx icon indicating copy to clipboard operation
openvsx copied to clipboard

X-Forwarded-Host header is not working when an array or comma separated list is used

Open benoitf opened this issue 2 years ago • 0 comments

Headers can be array values or be a single string with comma separated value

So when computing the host using X-Forwarded-Host it should use the first value and not the 'joined' list concatenate by a comma else it leads to invalid base URL

example:

https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#x-headers

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.

benoitf avatar Jul 27 '22 15:07 benoitf