Skip to content

Commit d3ca954

Browse files
committed
fix: Prevent caching of Docker agent install script and binaries
Add no-cache headers to both the install script and agent binary download endpoints to prevent browsers and curl from serving stale cached versions. This ensures users always get the latest install script with URL normalization fixes for trailing slash issues. Fixes #528
1 parent d8638ab commit d3ca954

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/api/router.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,6 +2566,11 @@ func (r *Router) handleDownloadInstallScript(w http.ResponseWriter, req *http.Re
25662566
return
25672567
}
25682568

2569+
// Prevent caching - always serve the latest version
2570+
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
2571+
w.Header().Set("Pragma", "no-cache")
2572+
w.Header().Set("Expires", "0")
2573+
25692574
scriptPath := "/opt/pulse/scripts/install-docker-agent.sh"
25702575
http.ServeFile(w, req, scriptPath)
25712576
}
@@ -2577,6 +2582,11 @@ func (r *Router) handleDownloadAgent(w http.ResponseWriter, req *http.Request) {
25772582
return
25782583
}
25792584

2585+
// Prevent caching - always serve the latest version
2586+
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
2587+
w.Header().Set("Pragma", "no-cache")
2588+
w.Header().Set("Expires", "0")
2589+
25802590
archParam := strings.TrimSpace(req.URL.Query().Get("arch"))
25812591
searchPaths := make([]string, 0, 4)
25822592

0 commit comments

Comments
 (0)