Skip to content

Commit

Permalink
X-Forwarded-For should be preserved
Browse files Browse the repository at this point in the history
  • Loading branch information
kotx committed Dec 7, 2024
1 parent 968767b commit 9837147
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func main() {

req.Host = endpointUrl.Host
for key, value := range req.Header {
if strings.HasPrefix(http.CanonicalHeaderKey("X-Remote-"), key) || strings.HasPrefix(http.CanonicalHeaderKey("X-Forwarded-For"), key) {
if strings.HasPrefix(http.CanonicalHeaderKey("X-Remote-"), key) {
slog.Info("removing spoofed header", "key", key, "value", value)
req.Header.Del(key)
}
Expand Down

0 comments on commit 9837147

Please sign in to comment.