From db0e7ed7df5e0f6e4146892a3ac2be9425324076 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Tue, 25 Sep 2012 22:10:45 +0200 Subject: Add headers to the status handler. --- src/ninjacloud.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ninjacloud.go b/src/ninjacloud.go index f2d31d7..25a84a4 100644 --- a/src/ninjacloud.go +++ b/src/ninjacloud.go @@ -632,6 +632,11 @@ 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") + w.Header().Add("Access-Control-Allow-Headers", "Content-Type, sourceURI, overwrite-destination, check-existence-only, recursive, return-type, operation, delete-source, file-filters, if-modified-since, get-file-info") + w.Header().Add("Access-Control-Allow-Methods", "POST, GET, DELETE, PUT") + w.Header().Add("Access-Control-Allow-Origin", "*/*") + w.Header().Add("Access-Control-Max-Age", "86400") cloudStatus := map[string]string{ "name": APP_NAME, "version": APP_VERSION, -- cgit v1.2.3