First webui commit

This commit is contained in:
Marco Realacci 2022-12-09 03:53:16 +01:00
parent e38f5d08ab
commit c4611b92f8
2011 changed files with 30382 additions and 1874 deletions

View file

@ -1,8 +1,9 @@
package main
import (
"github.com/gorilla/handlers"
"net/http"
"github.com/gorilla/handlers"
)
// applyCORSHandler applies a CORS policy to the router. CORS stands for Cross-Origin Resource Sharing: it's a security
@ -11,8 +12,10 @@ import (
func applyCORSHandler(h http.Handler) http.Handler {
return handlers.CORS(
handlers.AllowedHeaders([]string{
"x-example-header",
"Content-Type",
"Authorization",
}),
handlers.AllowCredentials(),
handlers.AllowedMethods([]string{"GET", "POST", "OPTIONS", "DELETE", "PUT"}),
handlers.AllowedOrigins([]string{"*"}),
)(h)