Skip to content

Commit

Permalink
chore: ignore all x-forwarded headers (#5032)
Browse files Browse the repository at this point in the history
* feat: add support for headers to webhooks

now we are passing x-* headers to source transformer

* chore: ignore all x-forwarded headers
  • Loading branch information
koladilip authored Aug 28, 2024
1 parent 5327d44 commit e832eae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gateway/webhook/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func getXHeaders(req *http.Request) map[string]string {
xHeaders := make(map[string]string)
for key, values := range req.Header {
lowerCaseKey := strings.ToLower(key)
if strings.HasPrefix(lowerCaseKey, "x-") && lowerCaseKey != "x-forwarded-for" {
if !strings.HasPrefix(lowerCaseKey, "x-forwarded-") && strings.HasPrefix(lowerCaseKey, "x-") {
xHeaders[key] = strings.Join(values, ",")
}
}
Expand Down

0 comments on commit e832eae

Please sign in to comment.