Skip to content

Commit

Permalink
strict check to remove keys
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekg999 committed Sep 28, 2024
1 parent 79c19a8 commit a4fa12a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hook/handlers/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ func Index(w http.ResponseWriter, r *http.Request) {
}

for key := range r.Header {
if strings.HasPrefix(key, "Cf-") || key == "Cdn-Loop" || key == "X-Real-IP" || key == "X-Forwarded-For" || key == "X-Forwarded-Proto" {
key_lower := strings.ToLower(key)
if strings.HasPrefix(key_lower, "cf-") || key_lower == "cdn-Loop" || key_lower == "x-real-ip" || key_lower == "x-forwarded-for" || key_lower == "x-forwarded-proto" {
r.Header.Del(key)
}
}
Expand Down

0 comments on commit a4fa12a

Please sign in to comment.