From 03ad5dcff6407f79a6840ed2dcb3d65cb9eaa517 Mon Sep 17 00:00:00 2001
From: Philipp Heckel <pheckel@datto.com>
Date: Fri, 25 Mar 2022 17:17:24 -0400
Subject: [PATCH] Add Allow-Origin: *, because YOLO

---
 server/server.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/server/server.go b/server/server.go
index 0e81cb6..c59d1ca 100644
--- a/server/server.go
+++ b/server/server.go
@@ -380,6 +380,7 @@ func (s *Server) handleFile(w http.ResponseWriter, r *http.Request, v *visitor)
 		return errHTTPTooManyRequestsAttachmentBandwidthLimit
 	}
 	w.Header().Set("Content-Length", fmt.Sprintf("%d", stat.Size()))
+	w.Header().Set("Access-Control-Allow-Origin", "*") // CORS, allow cross-origin requests
 	f, err := os.Open(file)
 	if err != nil {
 		return err
-- 
GitLab