diff --git a/src/main.rs b/src/main.rs index 4d921fa..b68619f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,12 +17,11 @@ use crate::{ statics::FAVICON, }; use actix_web::{ - http::header::{self, CacheControl, CacheDirective, Expires}, + http::header::{self, CacheControl, CacheDirective}, middleware, web, App, Error, HttpResponse, HttpServer, }; use awc::{http::StatusCode, Client}; use futures::Future; -use std::time::{Duration, SystemTime}; fn proxy_file( client: web::Data, @@ -42,13 +41,11 @@ fn proxy_file( .and_then(move |response| match response.status() { StatusCode::OK => { let mime = mime_guess::guess_mime_type(&data.file); - let expiration = SystemTime::now() + Duration::from_secs(2_592_000_000); Ok(HttpResponse::Ok() .content_type(mime.to_string().as_str()) - .set(Expires(expiration.into())) .set(CacheControl(vec![ - CacheDirective::MaxAge(2_592_000_000), CacheDirective::Public, + CacheDirective::MaxAge(2_592_000_000), ])) .streaming(response)) }