~emersion/kimchi

511cc61eefcfd4932d382f16f83200838811f2dd — Simon Ser 7 months ago a7e41c2
Set the Forwarded header
1 files changed, 2 insertions(+), 1 deletions(-)

M directives.go
M directives.go => directives.go +2 -1
@@ 146,8 146,9 @@ var backends = map[string]parseBackendFunc{
		proxy := httputil.NewSingleHostReverseProxy(target)
		director := proxy.Director
		proxy.Director = func(req *http.Request) {
			forwarded := fmt.Sprintf("for=%q;host=%q;proto=%q", req.RemoteAddr, req.Host, req.URL.Scheme)
			director(req)
			req.Host = target.Host
			req.Header.Set("Forwarded", forwarded)
		}
		return proxy, nil
	},