Skip to content

Commit

Permalink
add more allowedmethods for cors (#1109)
Browse files Browse the repository at this point in the history
  • Loading branch information
suchen-sci committed Oct 10, 2023
1 parent ffa49b5 commit ef3edf0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/api/dynamicmux.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ func (m *dynamicMux) reloadAPIs() {
}

// For access from browser.
cors := cors.New(cors.Options{})
cors := cors.New(cors.Options{
// By default, not allow delete method.
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"},
})
router.Use(cors.Handler)

for _, apiGroup := range apiGroups {
Expand Down

0 comments on commit ef3edf0

Please sign in to comment.