Skip to content

Commit

Permalink
Copy and append X-Forwarded-For header.
Browse files Browse the repository at this point in the history
Fixes #22.
  • Loading branch information
wi1dcard committed Nov 1, 2024
1 parent b740fd4 commit 59358b0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/reverseproxy/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func NewHTTPHandler(to *url.URL, reverseProxy *httputil.ReverseProxy, headerInje

func (f *HTTPHandler) rewriteFunc(r *httputil.ProxyRequest) {
r.SetURL(f.To)
r.Out.Header["X-Forwarded-For"] = r.In.Header["X-Forwarded-For"]
r.SetXForwarded()

if f.PreserveHost {
Expand Down

0 comments on commit 59358b0

Please sign in to comment.