fix: rest api cors proper usage (#1075)

This commit is contained in:
Prem Chaitanya Prathi 2024-03-28 07:34:36 +05:30 committed by GitHub
parent 53e0ea6ac6
commit e29cf0d191
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -41,6 +41,7 @@ func NewWakuRest(node *node.WakuNode, config RestConfig, log *zap.Logger) *WakuR
mux.Use(func(h http.Handler) http.Handler { mux.Use(func(h http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) { fn := func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Origin", "*")
h.ServeHTTP(w, r)
} }
return http.HandlerFunc(fn) return http.HandlerFunc(fn)
}) })