Skip to content

make cookie parsing case insensitive #207

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

Merged
merged 1 commit into from
May 13, 2020
Merged

Conversation

artemredkin
Copy link
Collaborator

Make cookie parsing case-insensitive, closes #205

Motivation:
As per https://tools.ietf.org/html/rfc6265#section-5.2.2, cookie names should be case-insensitive, and currently they are not.

Modifications:

  1. always split cookie component into name and optional value, lowercase the name and then match by this name using pre-defined lowercased constant
  2. modify one of the tests to send differently-cased cookie components

Result:
Cookie parsing is case-insensitive.

@artemredkin artemredkin requested review from weissi and Lukasa May 12, 2020 16:45
@artemredkin
Copy link
Collaborator Author

@swift-server-bot test this please

@artemredkin artemredkin merged commit f8b8de1 into master May 13, 2020
@artemredkin artemredkin deleted the fix_cookie_parsing branch May 13, 2020 08:34
@vlm
Copy link
Contributor

vlm commented May 13, 2020

This code introduces a denial of service.

#209

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Case-sensitive Set-Cookie parsing
4 participants