Skip to content

Commit

Permalink
Add omitempty to ALBTargetGroupRequest.Body
Browse files Browse the repository at this point in the history
If a lambda returns `Body: nil`, then the ALB returns a 502.
  • Loading branch information
Hugo Osvaldo Barrera committed Nov 23, 2021
1 parent ce10e61 commit 7f6e227
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion events/alb.go
Expand Up @@ -10,7 +10,7 @@ type ALBTargetGroupRequest struct {
MultiValueHeaders map[string][]string `json:"multiValueHeaders,omitempty"`
RequestContext ALBTargetGroupRequestContext `json:"requestContext"`
IsBase64Encoded bool `json:"isBase64Encoded"`
Body string `json:"body"`
Body string `json:"body,omitempty"`
}

// ALBTargetGroupRequestContext contains the information to identify the load balancer invoking the lambda
Expand Down
3 changes: 1 addition & 2 deletions events/testdata/alb-lambda-target-request-headers-only.json
Expand Up @@ -21,6 +21,5 @@
"x-imforwards": "20",
"x-myheader": "123"
},
"body": "",
"isBase64Encoded": false
}
}
Expand Up @@ -43,6 +43,6 @@
"123"
]
},
"body": "",
"body": "Some text",
"isBase64Encoded": false
}
}

0 comments on commit 7f6e227

Please sign in to comment.