Skip to content

Commit 077490b

Browse files
authored
Revert #408 and update alb response annotation per #408's original intent (#455)
* Revert "Add `omitempty` to ALBTargetGroupRequest.Body (#408)" This reverts commit 14da40f. * update alb response struct per #408 intent
1 parent 151c2c1 commit 077490b

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

events/alb.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type ALBTargetGroupRequest struct {
1010
MultiValueHeaders map[string][]string `json:"multiValueHeaders,omitempty"`
1111
RequestContext ALBTargetGroupRequestContext `json:"requestContext"`
1212
IsBase64Encoded bool `json:"isBase64Encoded"`
13-
Body string `json:"body,omitempty"`
13+
Body string `json:"body"`
1414
}
1515

1616
// ALBTargetGroupRequestContext contains the information to identify the load balancer invoking the lambda
@@ -29,6 +29,6 @@ type ALBTargetGroupResponse struct {
2929
StatusDescription string `json:"statusDescription"`
3030
Headers map[string]string `json:"headers"`
3131
MultiValueHeaders map[string][]string `json:"multiValueHeaders"`
32-
Body string `json:"body"`
32+
Body string `json:"body,omitempty"`
3333
IsBase64Encoded bool `json:"isBase64Encoded"`
3434
}

events/testdata/alb-lambda-target-request-headers-only.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
"x-imforwards": "20",
2222
"x-myheader": "123"
2323
},
24+
"body": "",
2425
"isBase64Encoded": false
25-
}
26+
}

events/testdata/alb-lambda-target-request-multivalue-headers.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@
4343
"123"
4444
]
4545
},
46-
"body": "Some text",
46+
"body": "",
4747
"isBase64Encoded": false
48-
}
48+
}

0 commit comments

Comments
 (0)