Open suntong opened 6 days ago
Describe the solution you'd like
Add the Content-Length headers.
As the Content-Length header is not added by the lib. Ref: https://github.com/search?q=repo%3Aaws%2Faws-lambda-go+Content-Length&type=code
However, It seems to be more than that for a proper fix, as I tried to add the Content-Length headers myself but it has no effect at all:
mux.HandleFunc("/hello", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Length", "12") // len("Hello World!")
w.WriteHeader(200)
w.Write([]byte("Hello World!"))
})
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is.
Following https://github.com/aws/aws-lambda-go/issues/508,
which get closed as a part of https://github.com/aws/aws-lambda-go/releases/tag/v1.42.0
However a quick search of
Content-Length
in the change log of https://github.com/aws/aws-lambda-go/compare/v1.41.0...v1.42.0did not get any hits:
Are the Content-Length headers being added now?
Describe the solution you'd like
Add the Content-Length headers, properly.
Additional context
For a handler like:
I was able to get return from it if I try it locally, However, if using lambdaurl, I got empty returns, i.e.,
Content-Length: 0
.Please double-check. Thanks