Skip to content

Commit

Permalink
capitalize X-Forwarded headers to be identical with ALB
Browse files Browse the repository at this point in the history
  • Loading branch information
frsyuki committed Dec 4, 2020
1 parent 38af0b2 commit 6a7cbc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ func MakeLambdaClient(endpoint string) *lambda.Lambda {
func MakeInvokeLambdaHandler(client *lambda.Lambda, functionName string, pb PayloadBuilder) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
// Add proxy headers
r.Header.Add("x-forwarded-for", r.RemoteAddr[0:strings.LastIndex(r.RemoteAddr, ":")])
r.Header.Add("x-forwarded-proto", "http")
r.Header.Add("x-forwarded-port", "8080")
r.Header.Add("X-Forwarded-For", r.RemoteAddr[0:strings.LastIndex(r.RemoteAddr, ":")])
r.Header.Add("X-Forwarded-Proto", "http")
r.Header.Add("X-Forwarded-Port", "8080")

// Parse HTTP response and create an event
payload, err := pb.BuildRequest(r)
Expand Down

0 comments on commit 6a7cbc3

Please sign in to comment.