feat: support downloading via token auth (#603)

This commit is contained in:
sigoden
2025-08-02 14:37:49 +08:00
committed by GitHub
parent 089d30c5a5
commit 9c9fca75d3
7 changed files with 277 additions and 33 deletions

View File

@@ -8,10 +8,10 @@ use std::{
time::{Duration, SystemTime, UNIX_EPOCH},
};
pub fn unix_now() -> Result<Duration> {
pub fn unix_now() -> Duration {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.with_context(|| "Invalid system time")
.expect("Unable to get unix epoch time")
}
pub fn encode_uri(v: &str) -> String {