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

Simplify http date parser according to RFC 7231 #92

Closed
wants to merge 1 commit into from

Conversation

ansiwen
Copy link
Contributor

@ansiwen ansiwen commented May 24, 2018

Before the date has been parsed according to RFC 1123. However, as
pointed out by issue #91, RFC 7231 defines a subset of this format
for HTTP dates (IMF-fixdate). This change simplifies the parser,
assuming the IMF-fixdate format according to RFC 7231. In violence
to RFC 7231 the legacy RFC 850 and asctime() formats are
intentionally not handled, as before.

Closes #91

Before the date has been parsed according to RFC 1123.  However, as
pointed out by issue inhabitedtype#91, RFC 7231 defines a subset of this format
for HTTP dates (IMF-fixdate).  This change simplifies the parser,
assuming the IMF-fixdate format according to RFC 7231.  In violence
to RFC 7231 the legacy RFC 850 and asctime() formats are
intentionally not handled, as before.

Closes inhabitedtype#91
@ansiwen ansiwen force-pushed the http-date-parser branch from 4037a59 to c6ae171 Compare May 24, 2018 10:27
@ansiwen ansiwen mentioned this pull request May 24, 2018
@ansiwen
Copy link
Contributor Author

ansiwen commented Jun 21, 2018

@seliopou ping

@seliopou
Copy link
Member

IIRC this is restricting the possible allowed inputs for the parser? That kindof runs counter to the Robustness Principle. Unless I'm missing something, I don't think this is a change worth making.

@hannesm
Copy link
Contributor

hannesm commented Nov 11, 2018

@seliopou in my opinion, Postel's law is wrong ;). in any case, I struggle with Scanf quite a bit, and would instead appreciate to have e.g. a dependency on Angstrom und use the parser combinators from there. My experience with scanf is that it accepts arbitrary trailing input. Similar to #93 I guess we should add test cases from the RFC to convince ourselves that the parser is not too strict.

@seliopou
Copy link
Member

seliopou commented Dec 1, 2018

Closing for now, we can revisit the change if/when the parser gets rewritten using angstrom.

@seliopou seliopou closed this Dec 1, 2018
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.

Wm_util.Date?
3 participants