Skip to content

Commit

Permalink
Allow all GET requests through CORS.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang committed Aug 15, 2024
1 parent 5d461a0 commit d3b1c1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d3b1c1f

Please sign in to comment.