summaryrefslogtreecommitdiff
path: root/src/ninjacloud.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/ninjacloud.go')
-rw-r--r--src/ninjacloud.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ninjacloud.go b/src/ninjacloud.go
index 54027d4..58146f7 100644
--- a/src/ninjacloud.go
+++ b/src/ninjacloud.go
@@ -279,6 +279,10 @@ func listDir(path string, recursive bool, filter []string, returnType string) (l
279 279
280func fileHandler(w http.ResponseWriter, r *http.Request) { 280func fileHandler(w http.ResponseWriter, r *http.Request) {
281 w.Header().Add("Cache-Control", "no-cache") 281 w.Header().Add("Cache-Control", "no-cache")
282 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")
283 w.Header().Add("Access-Control-Allow-Methods", "POST, GET, DELETE, PUT")
284 w.Header().Add("Access-Control-Allow-Origin", "*/*")
285 w.Header().Add("Access-Control-Max-Age", "86400")
282 p := filepath.Clean(r.URL.Path[filePathLen:]) 286 p := filepath.Clean(r.URL.Path[filePathLen:])
283 p = strings.TrimLeft(p, driveName) 287 p = strings.TrimLeft(p, driveName)
284 p = strings.TrimLeft(p, "/") 288 p = strings.TrimLeft(p, "/")
@@ -461,6 +465,10 @@ func fileHandler(w http.ResponseWriter, r *http.Request) {
461 465
462func dirHandler(w http.ResponseWriter, r *http.Request) { 466func dirHandler(w http.ResponseWriter, r *http.Request) {
463 w.Header().Add("Cache-Control", "no-cache") 467 w.Header().Add("Cache-Control", "no-cache")
468 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")
469 w.Header().Add("Access-Control-Allow-Methods", "POST, GET, DELETE, PUT")
470 w.Header().Add("Access-Control-Allow-Origin", "*/*")
471 w.Header().Add("Access-Control-Max-Age", "86400")
464 p := filepath.Clean(r.URL.Path[dirPathLen:]) 472 p := filepath.Clean(r.URL.Path[dirPathLen:])
465 p = strings.TrimLeft(p, driveName) 473 p = strings.TrimLeft(p, driveName)
466 p = strings.TrimLeft(p, "/") 474 p = strings.TrimLeft(p, "/")