add some no-cache headers

This commit is contained in:
Peter Cai 2020-04-08 21:12:58 +08:00
parent cd8f761fcf
commit fe22944cb4
No known key found for this signature in database
GPG key ID: 71F5FB4E4F3FD54F
2 changed files with 4 additions and 2 deletions

View file

@ -81,7 +81,8 @@ async fn default_route(_req: Request, url: Url) -> MyResult<Response> {
ResponseInit::new() ResponseInit::new()
.status(200) .status(200)
.headers(headers!{ .headers(headers!{
"Content-Type" => "text/html" "Content-Type" => "text/html",
"Cache-Control" => "no-cache"
}.as_ref()) }.as_ref())
).internal_err(); ).internal_err();
} }

View file

@ -79,7 +79,8 @@ async fn get_actions(_req: Request, url: Url) -> MyResult<Response> {
ResponseInit::new() ResponseInit::new()
.status(200) .status(200)
.headers(headers!{ .headers(headers!{
"Content-Type" => "application/json" "Content-Type" => "application/json",
"Cache-Control" => "no-cache"
}.add_cors().as_ref()) }.add_cors().as_ref())
).internal_err() ).internal_err()
} }