fix example

pull/1978/head
Lucas Nogueira 4 months ago
parent 39bc197137
commit ea860c47c0
No known key found for this signature in database
GPG Key ID: A05EE2227C581CD7

@ -106,7 +106,11 @@ pub fn run() {
if !headers.iter().any(|header| header.field == tiny_http::HeaderField::from_bytes(b"Cookie").unwrap()) { 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 = 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( headers.push(
tiny_http::Header::from_bytes( tiny_http::Header::from_bytes(
&b"Set-Cookie"[..], &b"Set-Cookie"[..],

Loading…
Cancel
Save