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
+16 -7
View File
@@ -18,10 +18,19 @@ type Debug struct {
Zpages bool
}
// CORS defines the available cors configuration.
type CORS struct {
AllowedOrigins []string
AllowedMethods []string
AllowedHeaders []string
AllowCredentials bool
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string
Root string
CORS CORS
}
// Service defines the available service configuration.
@@ -42,13 +51,13 @@ type Tracing struct {
// Config combines all available configuration parts.
type Config struct {
File string
Log Log
Debug Debug
HTTP HTTP
Tracing Tracing
Service Service
OcisPublicURL string
File string
Log Log
Debug Debug
HTTP HTTP
Tracing Tracing
Service Service
OcisPublicURL string
WebdavNamespace string
Context context.Context