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 <james@tailscale.com>
This commit is contained in:
James Tucker 2025-01-31 12:54:50 -08:00
parent 0a51bbc765
commit a9e5f88193
No known key found for this signature in database

View File

@ -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)
}