CacheControl private

This commit is contained in:
Valentin Brandl 2019-08-07 21:05:06 +02:00
parent bef5f70eab
commit 733c6135da
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D
2 changed files with 6 additions and 1 deletions

View File

@ -80,6 +80,7 @@ fn redirect<T: Service>(
LOCATION, LOCATION,
T::redirect_url(&data.user, &data.repo, &head, &data.file).as_str(), T::redirect_url(&data.user, &data.repo, &head, &data.file).as_str(),
) )
.set(CacheControl(vec![CacheDirective::Private]))
.finish() .finish()
})); }));
} }

View File

@ -4,7 +4,10 @@ use crate::{
statics::{load_env_var, GITHUB_AUTH_QUERY, OPT}, statics::{load_env_var, GITHUB_AUTH_QUERY, OPT},
}; };
use actix_web::{ use actix_web::{
http::{header::LOCATION, StatusCode}, http::{
header::{CacheControl, CacheDirective, LOCATION},
StatusCode,
},
web, Error, HttpResponse, web, Error, HttpResponse,
}; };
use awc::{error::PayloadError, Client, ClientResponse}; use awc::{error::PayloadError, Client, ClientResponse};
@ -268,6 +271,7 @@ impl Service for GitLab {
) )
.as_str(), .as_str(),
) )
.set(CacheControl(vec![CacheDirective::Private]))
.finish() .finish()
}) })
.from_err(), .from_err(),