summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJames Tucker <james@tailscale.com>2025-01-31 12:54:50 -0800
committerJames Tucker <james@tailscale.com>2025-01-31 12:58:34 -0800
commita9e5f88193195b03927be4cfc88498f0898ed5d6 (patch)
tree9ae38bd09dece69589fb20cf7cf3478da69fba34
parent0a51bbc7651a2414cde4b1e40ad726f7f19e3dc7 (diff)
downloadtailscale-raggi/derp-204-cache-control.tar.xz
tailscale-raggi/derp-204-cache-control.zip
derp/derphttp: set cache-control to disallow caching of captive portal checksraggi/derp-204-cache-control
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 <james@tailscale.com>
-rw-r--r--derp/derphttp/derphttp_server.go1
1 files changed, 1 insertions, 0 deletions
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)
}