From 236dd66cd04a34fc39e76ada9ba5793ce5249bf6 Mon Sep 17 00:00:00 2001 From: Fedorov Vladimir Date: Sat, 5 Oct 2024 00:49:48 +0700 Subject: [PATCH] fix --- cmd/cake_crm/main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/cake_crm/main.go b/cmd/cake_crm/main.go index f4d3853..e83bcdf 100644 --- a/cmd/cake_crm/main.go +++ b/cmd/cake_crm/main.go @@ -104,12 +104,12 @@ func main() { func cors(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - ua := r.Header.Get("User-Agent") - if !strings.HasPrefix(ua, "crabs") { - w.WriteHeader(403) - return - } - + // ua := r.Header.Get("User-Agent") + // if !strings.HasPrefix(ua, "crabs") { + // w.WriteHeader(403) + // return + // } + w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PATCH, DELETE") w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, Authorization, ResponseType")