From 03df1556e7ed08a182445eb66f2e301b7731c89a Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Thu, 14 Dec 2023 23:50:09 +0000 Subject: [PATCH] Trim / from end of origin --- server/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/server.go b/server/server.go index dad2fc7..69ad3e3 100644 --- a/server/server.go +++ b/server/server.go @@ -9,6 +9,7 @@ import ( "github.com/rs/cors" "log" "net/http" + "strings" "sync/atomic" "time" ) @@ -71,7 +72,7 @@ func NewHttpServer(conf Conf, signer mjwt.Signer) *HttpServer { var corsAccessControl = cors.New(cors.Options{ AllowOriginFunc: func(origin string) bool { load := hs.services.Load() - _, ok := (*load)[origin] + _, ok := (*load)[strings.TrimSuffix(origin, "/")] return ok }, AllowedMethods: []string{http.MethodPost, http.MethodOptions},