mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-23 12:56:47 +00:00
uv-client: switch to RFC 9110 compatible format (#8752)
This still utilizes the RFC 2822 datetime formatter, but utilizes new methods [added in jiff 0.1.14] to emit timestamps in a format strictly compatible with RFC 9110. It seems like most HTTP servers were pretty flexible and supported RFC 2822 datetime formats, but #8747 shows at least one case where that isn't true. Given that the [MDN docs prescribe RFC 9110], we defer to them. Fixes #8747 [added in jiff 0.1.14]: https://github.com/BurntSushi/jiff/pull/154 [MDN docs prescribe RFC 9110]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since
This commit is contained in:
parent
f8291144c0
commit
049ccf7d77
3 changed files with 5 additions and 7 deletions
|
|
@ -1381,11 +1381,9 @@ fn unix_timestamp_to_rfc2822(seconds: u64) -> Option<String> {
|
|||
use jiff::fmt::rfc2822::DateTimePrinter;
|
||||
|
||||
unix_timestamp_to_datetime(seconds).and_then(|timestamp| {
|
||||
let mut buf = String::new();
|
||||
DateTimePrinter::new()
|
||||
.print_timestamp(×tamp, &mut buf)
|
||||
.ok()?;
|
||||
Some(buf)
|
||||
.timestamp_to_rfc9110_string(×tamp)
|
||||
.ok()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue