Add login page for protected shares

This commit is contained in:
viktorstrate
2020-06-14 20:56:48 +02:00
parent 79be996985
commit fef27c5640
5 changed files with 167 additions and 42 deletions

View File

@@ -14,7 +14,7 @@ func CORSMiddleware(devMode bool) mux.MiddlewareFunc {
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
methods := []string{http.MethodGet, http.MethodPost, http.MethodOptions}
headers := []string{"authorization", "content-type", "content-length"}
headers := []string{"authorization", "content-type", "content-length", "TokenPassword"}
w.Header().Set("Access-Control-Allow-Methods", strings.Join(methods, ","))
w.Header().Set("Access-Control-Allow-Headers", strings.Join(headers, ","))