From d3b1c1f20f535f647b336d05cb325b0797c56f56 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Wed, 14 Aug 2024 18:52:01 -0700 Subject: [PATCH] Allow all GET requests through CORS. --- server/server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/server.go b/server/server.go index 10e1a01..d3cbd39 100644 --- a/server/server.go +++ b/server/server.go @@ -48,6 +48,10 @@ func (s *Server) Start() error { AllowHeaders: []string{echo.HeaderOrigin, echo.HeaderContentType, echo.HeaderAccept, echo.HeaderAuthorization}, AllowCredentials: true, AllowOriginFunc: func(origin string) (bool, error) { + // Allow all GET requests + if strings.EqualFold(echo.GET, echo.HeaderXHTTPMethodOverride) { + return true, nil + } allowedOrigins := []string{ ".comfyci.org", // Any subdomain of comfyci.org os.Getenv("CORS_ORIGIN"), // Environment-specific allowed origin