Skip to content
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

When modifying the headers, split the value may cause unexpected bug #10156

Closed
spacewander opened this issue May 3, 2024 · 2 comments · Fixed by #10191
Closed

When modifying the headers, split the value may cause unexpected bug #10156

spacewander opened this issue May 3, 2024 · 2 comments · Fixed by #10191
Assignees
Labels
kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it

Comments

@spacewander
Copy link
Contributor

What happened?

In

for i, headerValue := range headerValues(set.Value) {

the header value is split by ,, and then added one by one.

In case like Set-Cookie: id=a3fWa; Expires=Wed, 21 Oct 2015 07:28:00 GMT, it will be added as:
Set-Cookie: id=a3fWa; Expires=Wed and
Set-Cookie: 21 Oct 2015 07:28:00 GMT

I wonder why not set the header directly without any splitting?

@spacewander spacewander added kind/bug A bug triage/pending This issue will be looked at on the next triage meeting labels May 3, 2024
@michaelbeaumont michaelbeaumont added triage/accepted The issue was reviewed and is complete enough to start working on it and removed triage/pending This issue will be looked at on the next triage meeting labels May 3, 2024
@michaelbeaumont
Copy link
Contributor

michaelbeaumont commented May 3, 2024

This may be an oversight, particularly important for Set-Cookie, regarding directives from the gateway API docs at the time. I think Envoy will do the right thing here, we should change this.

@spacewander
Copy link
Contributor Author

@michaelbeaumont
Would you assign this to me? I would submit a PR to change it a few days later.

spacewander added a commit to spacewander/kuma that referenced this issue May 7, 2024
Fix kumahq#10156
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
michaelbeaumont pushed a commit that referenced this issue May 14, 2024
Fixes #10156

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
Co-authored-by: Charly Molter <charly.molter@konghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug triage/accepted The issue was reviewed and is complete enough to start working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants