-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fmt/rfc2822: add routines explicitly for RFC 9110
It seems that RFC 9110 does not support offsets like `-0000` in the date format, and also requires that days be padded to two digits in all cases. This meant that Jiff's RFC 2822 output was, strictly speaking, incompatible with a strict implementation of RFC 9110. For example, it would output this: Thu, 1 Jan 1970 00:00:01 -0000 Where RFC 9110 would want this: Thu, 01 Jan 1970 00:00:01 GMT I am actually still unclear as to the relationship between RFC 2822/5322 and RFC 9110, but as far as I know, RFC 2822 has been obsoleted by RFC 5322, but RFC 5322 does not seem to make any meaningful changes to the datetime format: https://datatracker.ietf.org/doc/html/rfc5322#section-3.3 But, since it seems like the RFC 9110 format is a subset of the RFC 2822/5322 format, and since [MDN clearly stipulates the use of RFC 9110], we add a new method that outputs a RFC 2822 compatible timestamp that is explicitly compatible with RFC 9110. Fixes #151 [MDN clearly stipulates the use of RFC 9110]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since
- Loading branch information
1 parent
d3e0a16
commit 2f57962
Showing
1 changed file
with
174 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters