Fix RFC 850 two-digit year parsing - #1951
Conversation
PR HealthUnused Dependencies ✔️
For details on how to fix these, see dependency_validator. This check can be disabled by tagging the PR with Breaking changes ✔️
This check can be disabled by tagging the PR with API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
This check can be disabled by tagging the PR with Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with Coverage ✔️
This check for test coverage is informational (issues shown here will not fail the PR). This check can be disabled by tagging the PR with License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
This check can be disabled by tagging the PR with |
Co-authored-by: Brian Quinlan <bquinlan@google.com>
|
Could you fix the lint so that I can merge this? |
fixed |
Summary
Root cause
parseHttpDate()always added 1900 to RFC 850's two-digit year, so26was parsed as 1926 regardless of the current year.Impact
RFC 850 timestamps such as those used in
Retry-Afterheaders now resolve to the correct century instead of potentially being treated as expired.Closes #1939
Validation
dart format --output=none --set-exit-if-changed .dart analyze --fatal-infosdart test --platform vmdart test --platform chromedart test --platform chrome --compiler dart2wasm