diff --git a/main.go b/main.go index 5770749..3123cac 100644 --- a/main.go +++ b/main.go @@ -14,6 +14,7 @@ var hidden = flag.Bool("hidden", false, "allow serving hidden dirs") func logger(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Add("Access-Control-Allow-Origin", "*") log.Printf("%s: %s\n", r.RemoteAddr, r.URL) if !*hidden && strings.Contains(r.URL.Path, "/.") { http.Error(w, "hidden files and directories are not allowed", http.StatusUnauthorized)