cors fix
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m9s

This commit is contained in:
Smile Rex
2026-01-21 12:36:25 +03:00
parent 3c989c33f8
commit 9cd779fbea
2 changed files with 9 additions and 168 deletions

View File

@@ -8,6 +8,15 @@ import (
)
func (h *Hub) ws(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "GET, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization")
if r.Method == "OPTIONS" {
w.WriteHeader(http.StatusOK)
return
}
upgrader := websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool { return true },
}