Skip to content

Commit ea860c4

Browse files
committed
fix example
1 parent 39bc197 commit ea860c4

File tree

1 file changed

+5
-1
lines changed
  • examples/api/src-tauri/src

1 file changed

+5
-1
lines changed

examples/api/src-tauri/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ pub fn run() {
106106

107107
if !headers.iter().any(|header| header.field == tiny_http::HeaderField::from_bytes(b"Cookie").unwrap()) {
108108
let expires = time::OffsetDateTime::now_utc() + time::Duration::days(1);
109-
let expires_str = expires.format(&time::format_description::well_known::Rfc2822).unwrap();
109+
// RFC 1123 format
110+
let format = time::macros::format_description!(
111+
"[weekday repr:short], [day] [month repr:short] [year] [hour]:[minute]:[second] GMT"
112+
);
113+
let expires_str = expires.format(format).unwrap();
110114
headers.push(
111115
tiny_http::Header::from_bytes(
112116
&b"Set-Cookie"[..],

0 commit comments

Comments
 (0)