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

bpo-34951 Updated regex in pattern for finding cookie (rfc2616) #19393

Closed
wants to merge 1 commit into from

Conversation

lpopil
Copy link

@lpopil lpopil commented Apr 6, 2020

Updated regex for special case for "expires" attr in pattern for finding cookie if day of week is specified in deprecated format (rfc2616).

According to https://tools.ietf.org/html/rfc2616#section-3.3.1, clients and servers that parse the date value MUST accept all three formats (for compatibility with HTTP/1.0).

But the current regular expression does not match dates in the following format:

  Sunday, 06-Nov-94 08:49:37 GMT

https://bugs.python.org/issue34951

… cookie if day of week is specified in deprecated format(rfc2616).
@the-knights-who-say-ni
Copy link

the-knights-who-say-ni commented Apr 6, 2020

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@lpopil

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@lpopil lpopil changed the title Updated regex in pattern for finding cookie (rfc2616) bpo-34951 Updated regex in pattern for finding cookie (rfc2616) Apr 6, 2020
@taleinat
Copy link
Contributor

taleinat commented Sep 26, 2020

I've confirmed that without this PR, the existing regular expression _CookiePattern doesn't properly recognize the string 'expires = Sunday, 06-Nov-94 08:49:37 GMT', and that this PR does indeed fix that.

Copy link
Contributor

@taleinat taleinat left a comment

Thanks for working on this!

This PR will need tests checking that this parsing works as expected on several examples of "expires" dates.

Also, this PR doesn't add support for the third date format described in RFC 2616 section 3.3.1, the "ANSI C's asctime() format", for example: Sun Nov 6 08:49:37 1994. If we're going to fix this to properly support the spec, let's do it right!

@bedevere-bot
Copy link

bedevere-bot commented Sep 26, 2020

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@AlexWaygood
Copy link
Member

AlexWaygood commented Apr 19, 2022

Changes were requested by a core dev around a year and half ago, but have not been made. I am therefore closing this PR.

@lpopil, if you're still interested in working on this issue, feel free to open a new PR. Alternatively, ping me, and I'll happily reopen the PR. Thanks! 🙂

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

Successfully merging this pull request may close these issues.

None yet

5 participants