From f7d690f312e64372166f97472214219283999cea Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Fri, 21 Sep 2012 17:02:42 +0200 Subject: Add header to disable browser caching. --- src/ninjacloud.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/ninjacloud.go b/src/ninjacloud.go index 984f6a9..326834c 100644 --- a/src/ninjacloud.go +++ b/src/ninjacloud.go @@ -290,6 +290,7 @@ func osPath(p string) string { //// File APIs func fileHandler(w http.ResponseWriter, r *http.Request) { + w.Header().Add("Cache-Control", "no-cache") p := osPath(r.URL.Path[filePathLen:]) if !isInRoot(p) { w.WriteHeader(http.StatusForbidden) @@ -454,6 +455,7 @@ func fileHandler(w http.ResponseWriter, r *http.Request) { //// Directory APIs func dirHandler(w http.ResponseWriter, r *http.Request) { + w.Header().Add("Cache-Control", "no-cache") p := osPath(r.URL.Path[dirPathLen:]) if !isInRoot(p) { w.WriteHeader(http.StatusForbidden) @@ -607,6 +609,7 @@ func getDataHandler(w http.ResponseWriter, r *http.Request) { // Get the cloud status JSON func getStatusHandler(w http.ResponseWriter, r *http.Request) { + w.Header().Add("Cache-Control", "no-cache") cloudStatus := map[string]string{ "name": APP_NAME, "version": APP_VERSION, -- cgit v1.2.3