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

Commit b7ac5d5

Browse files
committed
Removed requirement for at least 1 header in responses to address #3.
1 parent bcfd58d commit b7ac5d5

2 files changed

Lines changed: 0 additions & 10 deletions

File tree

core/response.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ func (r *ProxyResponseWriter) WriteHeader(status int) {
6060
// Returns a populated proxy response object. If the reponse is invalid, for example
6161
// has no headers or an invalid status code returns an error.
6262
func (r *ProxyResponseWriter) GetProxyResponse() (events.APIGatewayProxyResponse, error) {
63-
if len(r.headers) == 0 {
64-
return events.APIGatewayProxyResponse{}, errors.New("No headers generated for response")
65-
}
66-
6763
if r.status == defaultStatusCode {
6864
return events.APIGatewayProxyResponse{}, errors.New("Status code not set on response")
6965
}

core/response_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ var _ = Describe("ResponseWriter tests", func() {
5252
Context("Export API Gateway proxy response", func() {
5353
noHeaderResponse := NewProxyResponseWriter()
5454

55-
It("Refuses responses with no headers", func() {
56-
_, err := noHeaderResponse.GetProxyResponse()
57-
Expect(err).ToNot(BeNil())
58-
Expect("No headers generated for response").To(Equal(err.Error()))
59-
})
60-
6155
emtpyResponse := NewProxyResponseWriter()
6256
emtpyResponse.Header().Add("Content-Type", "application/json")
6357

0 commit comments

Comments
 (0)