openvsx icon indicating copy to clipboard operation
openvsx copied to clipboard

fix: X-Forwarded-Host header can be array or comma separated list

Open benoitf opened this issue 3 years ago • 1 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.

Fixes https://github.com/eclipse/openvsx/issues/498

Change-Id: I4407776a5296809e304e3c8b10dafe50e9929035 Signed-off-by: Florent Benoit [email protected]

benoitf avatar Jul 27 '22 15:07 benoitf

@amvanbaren if you can review my PR Unit tests are provided

benoitf avatar Aug 03 '22 08:08 benoitf

Hi, what is preventing this PR to be merged ?

benoitf avatar Sep 12 '22 11:09 benoitf