Skip to content

add another expires date format #315

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 2 commits into from
Nov 11, 2020

Conversation

artemredkin
Copy link
Collaborator

Adds rfc2616#section-3.3.1 date format parsing.

Motivation:
The https://tools.ietf.org/html/rfc2616#section-3.3.1 specifies the Sunday, 06-Nov-94 08:49:37 GMT as a valid date format. We need to support that.

Modifications:
Updated cookie parsing to support additional date format.

Result:
Closes #314

@artemredkin artemredkin added this to the 1.2.2 milestone Nov 11, 2020
@artemredkin artemredkin requested a review from Lukasa November 11, 2020 11:39
Copy link
Collaborator

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RFC 2616 was obsoleted a while back. The relevant citation is now RFC 7231 § 7.1.1.1, and that provides us a normative MUST:

A recipient that parses a timestamp value in an HTTP header field
MUST accept all three HTTP-date formats.

We are currently only accepting two: we should update this patch to tolerate all three.

@artemredkin artemredkin force-pushed the update_expires_date_parsing branch from 7dbc774 to 011d744 Compare November 11, 2020 12:30
@artemredkin
Copy link
Collaborator Author

Good catch, fixed!

@artemredkin artemredkin requested a review from Lukasa November 11, 2020 12:42
Copy link
Collaborator

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Lukasa Lukasa merged commit 1bc2e1a into swift-server:main Nov 11, 2020
@artemredkin artemredkin deleted the update_expires_date_parsing branch November 11, 2020 16:05
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.

A valid Expires= part of Set-Cookie header is not recognized
2 participants