update CORS middleware and make it configurable

This commit is contained in:
David Christofas
2021-10-22 13:27:31 +02:00
parent c370276198
commit 9ecc065879
29 changed files with 365 additions and 39 deletions
+4
View File
@@ -22,6 +22,10 @@ func Server(opts ...Option) (*http.Server, error) {
debug.Zpages(options.Config.Debug.Zpages),
debug.Health(health(options.Config)),
debug.Ready(ready(options.Config)),
debug.CorsAllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins),
debug.CorsAllowedMethods(options.Config.HTTP.CORS.AllowedMethods),
debug.CorsAllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders),
debug.CorsAllowCredentials(options.Config.HTTP.CORS.AllowCredentials),
), nil
}