Skip to content

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 Lukasa and weissi 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