fmt/rfc2822: add routines explicitly for RFC 9110 #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It seems that RFC 9110 does not support offsets like
-0000
in thedate 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:
Where RFC 9110 would want this:
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