-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double cookie headers #121
Comments
I haven't used Rust before but this might be the culprit: let mut headers = ag.headers;
update_xray_trace_id_header(&mut headers);
if let Some(cookies) = ag.cookies {
if let Ok(header_value) = HeaderValue::from_str(&cookies.join(";")) {
headers.append(http::header::COOKIE, header_value);
}
} It copies all of the the headers from the event, and then appends a cookie header if the event also contains cookies. If you look at the event JSON in my original comment, you can see the headers object already includes the |
Thanks for reporting this issue. I can reproduce it with Lambda Function URL. I will investigate. And, this does not happen with API GW HTTP API. You can use API GW as a workaround before this issue is fixed for Function URLs. |
API GW HTTP API v2 request format is slightly different. It does not have We should use |
Thanks for the quick fix @bnusunny - it's much appreciated! |
Hi. I'm trying to use this with a Lambda Function URL and am seeing duplicate cookie headers.
I run this command:
The Lambda function behind it responds with the request headers. The response is this, with 2 cookie headers:
Contents of
Dockerfile
:Contents of
server.py
:I changed the Lambda function to a Python runtime zip package with this code:
And the curl response becomes this, with only 1 cookie:
Unfortunately the extra header triggers a problem in my Gunicorn/Flask project making it unable to parse the session cookie. That seems like a bug in one of those projects, but it shouldn't be receiving 2 cookie headers in the first place.
The text was updated successfully, but these errors were encountered: