cors package is net/http handler to handle CORS related requests as defined by http://www.w3.org/TR/cors/ You can configure it by passing an option struct to cors.New: c := cors.New(cors.Options{ AllowedOrigins: []string{"foo.com"}, AllowedMethods: []string{"GET", "POST", "DELETE"}, AllowCredentials: true, }) Then insert the handler in the chain: handler = c.Handler(handler) See Options documentation for more options.
cors package is net/http handler to handle CORS related requests as defined by http://www.w3.org/TR/cors/ You can configure it by passing an option struct to cors.New: c := cors.New(cors.Options{ AllowedOrigins: []string{"foo.com"}, AllowedMethods: []string{"GET", "POST", "DELETE"}, AllowCredentials: true, }) Then insert the handler in the chain: handler = c.Handler(handler) See Options documentation for more options.
Package cors is net/http handler to handle CORS related requests as defined by http://www.w3.org/TR/cors/
This code implements the flow chart that can be found here.
Package cors is net/http handler to handle CORS related requests as defined by http://www.w3.org/TR/cors/
cors package is net/http handler to handle CORS related requests as defined by http://www.w3.org/TR/cors/
cors package is net/http handler to handle CORS related requests as defined by http://www.w3.org/TR/cors/
cors package is net/http handler to handle CORS related requests as defined by http://www.w3.org/TR/cors/
cors package is net/http handler to handle CORS related requests as defined by http://www.w3.org/TR/cors/
Package service provides middleware functionalities for setting a service-name context key and optional service-name related header.