From ea860c47c0e6942045e24ccfd7f6c792763329ae Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Sun, 16 Mar 2025 17:36:29 -0300 Subject: [PATCH] fix example --- examples/api/src-tauri/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/api/src-tauri/src/lib.rs b/examples/api/src-tauri/src/lib.rs index 80c07e16..e4ef2062 100644 --- a/examples/api/src-tauri/src/lib.rs +++ b/examples/api/src-tauri/src/lib.rs @@ -106,7 +106,11 @@ pub fn run() { if !headers.iter().any(|header| header.field == tiny_http::HeaderField::from_bytes(b"Cookie").unwrap()) { let expires = time::OffsetDateTime::now_utc() + time::Duration::days(1); - let expires_str = expires.format(&time::format_description::well_known::Rfc2822).unwrap(); + // RFC 1123 format + let format = time::macros::format_description!( + "[weekday repr:short], [day] [month repr:short] [year] [hour]:[minute]:[second] GMT" + ); + let expires_str = expires.format(format).unwrap(); headers.push( tiny_http::Header::from_bytes( &b"Set-Cookie"[..],