Closed dave-malone closed 6 years ago
I'd be suspicious of responses that return 0 headers. Is there a case where this may happen?
The default behavior of Golang's http.HandlerFunc is to write a response without headers (headers slice is empty). Enforcing that a header is always returned would create an awkward scenario for developers who wouldn't normally use any headers in their response (see my PR's test case for handlerfunc).
Done.
An http.HandlerFunc can return a response without any headers by default, and as far as I know, it's a valid http response to have an empty set of headers.
https://github.com/awslabs/aws-lambda-go-api-proxy/blob/master/core/response.go#L63,L65