Revert "Replace time with std::time in components/net (#31079)" (#31120)

This reverts commit 580062228b.
This commit is contained in:
Martin Robinson 2024-01-18 16:10:48 +01:00 committed by GitHub
parent c3fd27c225
commit 8e5f28839c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 123 additions and 161 deletions

View file

@ -122,10 +122,7 @@ impl HttpState {
}
fn precise_time_ms() -> u64 {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap_or_default()
.as_millis() as u64
time::precise_time_ns() / (1000 * 1000)
}
// Step 3 of https://fetch.spec.whatwg.org/#concept-fetch.
@ -2111,6 +2108,7 @@ async fn cors_preflight_fetch(
.typed_get::<AccessControlMaxAge>()
.map(|acma| acma.into())
.unwrap_or(Duration::from_secs(5));
let max_age = max_age.as_secs() as u32;
// Substep 10
// TODO: Need to define what an imposed limit on max-age is