From 6be4b9690ecaf375532dfafd06d3915db5848acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Geisendo=CC=88rfer?= Date: Fri, 10 May 2013 13:58:28 +0200 Subject: [PATCH] Add comments for CORS stuff --- src/cmd/tusd/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cmd/tusd/main.go b/src/cmd/tusd/main.go index 1c0c65d..c12348a 100644 --- a/src/cmd/tusd/main.go +++ b/src/cmd/tusd/main.go @@ -54,9 +54,14 @@ func main() { http.HandleFunc(basePath, func(w http.ResponseWriter, r *http.Request) { // Allow CORS for almost everything. This needs to be revisted / limited to // routes and methods that need it. + + // Domains allowed to make requests w.Header().Add("Access-Control-Allow-Origin", "*") + // Methods clients are allowed to use w.Header().Add("Access-Control-Allow-Methods", "HEAD,GET,PUT,POST,PATCH,DELETE") + // Headers clients are allowed to send w.Header().Add("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Content-Disposition, Final-Length, Offset") + // Headers clients are allowed to receive w.Header().Add("Access-Control-Expose-Headers", "Location, Range, Content-Disposition, Offset") if r.Method == "OPTIONS" {