#185 ALB/ELB set cookies when multiValueHeaders is not set#186
#185 ALB/ELB set cookies when multiValueHeaders is not set#186jordaneremieff merged 1 commit intoKludex:mainfrom
Conversation
| "headers": { | ||
| "content-type": "text/plain; charset=utf-8", | ||
| "set-cookie": "cookie1=cookie1; Secure", | ||
| "Set-cookie": "cookie2=cookie2; Secure", | ||
| }, | ||
| "multiValueHeaders": {}, |
There was a problem hiding this comment.
Only one of headers and multiValueHeaders should be specified
"You must use multiValueHeaders if you have enabled multi-value headers and headers otherwise"
There was a problem hiding this comment.
The documentation you linked makes it sound like all headers should be in multiValueHeaders, even those with a single value, if it is enabled.
I'm not sure if 0.11.0 did this or did what the current "main" branch does and only send the headers that have multiple values in multiValueHeaders.
I think using one or the other may be the way to go, it's a bit easier to understand what is going on, and is how the ALB documentation reads online. Let us know what AWS says if anything.
| if multi_value_headers: | ||
| event["multiValueHeaders"] = {} |
There was a problem hiding this comment.
again this specifies headers and multiValueHeaders
|
The use of different case to send multiple headers makes me a little nervous. |
|
Thanks @nathanglover for the PR and @jurasofish for the discussion. Regarding the headers in the response, there was a previous PR (ultimately not merged) where this was discussed and the user reached the similar conclusion of this PR, so I think I will merge it but we can revisit later specifically if there are issues. |
I believe this fixes #185 by adding back the code used in 0.11.0.
Let me know if anything else should be added or removed.