From bef5f70eab7e162086f06e09a96702a34fee6f1c Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Wed, 7 Aug 2019 21:01:09 +0200 Subject: [PATCH] Revert "Don't cache redirects" This reverts commit 2778b3ac84b697f8e3412d281f6a05c8f0c6bbd2. --- backend/src/main.rs | 4 ---- backend/src/service.rs | 9 +-------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/backend/src/main.rs b/backend/src/main.rs index 315056d..20bd518 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -80,10 +80,6 @@ fn redirect( LOCATION, T::redirect_url(&data.user, &data.repo, &head, &data.file).as_str(), ) - .set(CacheControl(vec![ - CacheDirective::Public, - CacheDirective::MaxAge(0), - ])) .finish() })); } diff --git a/backend/src/service.rs b/backend/src/service.rs index fac8330..4f1e924 100644 --- a/backend/src/service.rs +++ b/backend/src/service.rs @@ -4,10 +4,7 @@ use crate::{ statics::{load_env_var, GITHUB_AUTH_QUERY, OPT}, }; use actix_web::{ - http::{ - header::{CacheControl, CacheDirective, LOCATION}, - StatusCode, - }, + http::{header::LOCATION, StatusCode}, web, Error, HttpResponse, }; use awc::{error::PayloadError, Client, ClientResponse}; @@ -271,10 +268,6 @@ impl Service for GitLab { ) .as_str(), ) - .set(CacheControl(vec![ - CacheDirective::Public, - CacheDirective::MaxAge(0), - ])) .finish() }) .from_err(),