From a9e5f88193195b03927be4cfc88498f0898ed5d6 Mon Sep 17 00:00:00 2001 From: James Tucker Date: Fri, 31 Jan 2025 12:54:50 -0800 Subject: [PATCH] derp/derphttp: set cache-control to disallow caching of captive portal checks Observed on some airlines, Squid is configured to cache and transform these results, which is disruptive. The server and client should both actively request that this is not done. Updates #14856 Signed-off-by: James Tucker --- derp/derphttp/derphttp_server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/derp/derphttp/derphttp_server.go b/derp/derphttp/derphttp_server.go index ed7d3d707..6d8053eb6 100644 --- a/derp/derphttp/derphttp_server.go +++ b/derp/derphttp/derphttp_server.go @@ -98,6 +98,7 @@ func ServeNoContent(w http.ResponseWriter, r *http.Request) { w.Header().Set(NoContentResponseHeader, "response "+challenge) } } + w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate, no-transform, max-age=0") w.WriteHeader(http.StatusNoContent) }