Skip to content

Commit 8c9ae34

Browse files
authored
feat: add allow method to api server when allow cors (#4259)
Signed-off-by: Cheyu Wu <[email protected]>
1 parent 57b5b9c commit 8c9ae34

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apiserver/cmd/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ func startHttpProxy() {
155155
klog.Info("Enabling CORS with Access-Control-Allow-Origin:", *corsAllowOrigin)
156156
c := cors.New(cors.Options{
157157
AllowedOrigins: []string{*corsAllowOrigin},
158+
AllowedMethods: []string{
159+
http.MethodGet, http.MethodPost,
160+
http.MethodPut, http.MethodPatch,
161+
http.MethodDelete, http.MethodOptions,
162+
},
158163
})
159164
corsHandler = c.Handler
160165
} else {

0 commit comments

Comments
 (0)