Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit afc343d

Browse files
committed
Add headers to API GW proxy response.
1 parent 6fd93a1 commit afc343d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

core/response.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,17 @@ func (r *ProxyResponseWriter) GetProxyResponse() (events.APIGatewayProxyResponse
8585
isBase64 = true
8686
}
8787

88+
proxyHeaders := make(map[string]string, len(r.headers))
89+
90+
for h := range r.headers {
91+
proxyHeaders[h] = r.headers.Get(h)
92+
}
93+
8894
return events.APIGatewayProxyResponse{
8995
StatusCode: r.status,
9096
MultiValueHeaders: http.Header(r.headers),
9197
Body: output,
9298
IsBase64Encoded: isBase64,
99+
Headers: proxyHeaders,
93100
}, nil
94101
}

0 commit comments

Comments
 (0)