vibe-d / vibe.d

Official vibe.d development

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTTPServerRequest.fullURL value is incorrect if the request had passed through more than one HTTP proxy.

dbankov-vmware opened this issue · comments

HTTPServerRequest.fullURL tries to recreate the URL used on the client which resulted in the HTTPServerRequest taking into account the values of the "X-Forwarded-Host", "X-Forwarded-Proto" and "X-Forwarded-Port" headers which are updated by any HTTP proxy servers residing between the client and the server. The current implementation assumes that there is only one value in each of these headers however it is possible these to include multiple values in case the communication goes through more than one HTTP Proxy (which is the case when a vibe.d based service is executed in a Kubernetes deployment). The result is that fullURL returns an incorrect URL which makes this property unusable in a (Kubernetes) scenario with multiple HTTP Proxies.