mirror of
https://github.com/hacdias/webdav.git
synced 2026-09-22 03:20:41 +08:00
feat: update default CORS settings
This commit is contained in:
@@ -128,18 +128,36 @@ log:
|
|||||||
# CORS configuration
|
# CORS configuration
|
||||||
cors:
|
cors:
|
||||||
# Whether or not CORS configuration should be applied. Default is 'false'.
|
# Whether or not CORS configuration should be applied. Default is 'false'.
|
||||||
# This is an example of how you can enable CORS.
|
|
||||||
enabled: true
|
enabled: true
|
||||||
credentials: true
|
credentials: true
|
||||||
allowed_headers:
|
# The following are the default CORS settings when it is enabled.
|
||||||
- Depth
|
|
||||||
allowed_hosts:
|
allowed_hosts:
|
||||||
- *
|
- *
|
||||||
|
allowed_headers:
|
||||||
|
- Authorization
|
||||||
|
- Content-Type
|
||||||
|
- Depth
|
||||||
|
- Destination
|
||||||
|
- If
|
||||||
|
- Lock-Token
|
||||||
|
- Overwrite
|
||||||
|
- TimeOut
|
||||||
|
- Translate
|
||||||
allowed_methods:
|
allowed_methods:
|
||||||
|
- COPY
|
||||||
|
- DELETE
|
||||||
- GET
|
- GET
|
||||||
exposed_headers:
|
- HEAD
|
||||||
- Content-Length
|
- LOCK
|
||||||
- Content-Range
|
- UNLOCK
|
||||||
|
- MKCOL
|
||||||
|
- MOVE
|
||||||
|
- OPTIONS
|
||||||
|
- POST
|
||||||
|
- PROPFIND
|
||||||
|
- PROPPATCH
|
||||||
|
- PUT
|
||||||
|
exposed_headers: []
|
||||||
|
|
||||||
# You define here the list of users.
|
# You define here the list of users.
|
||||||
# Basic authentication is automatically be configured when users are detected
|
# Basic authentication is automatically be configured when users are detected
|
||||||
|
|||||||
+2
-2
@@ -86,9 +86,9 @@ func ParseConfig(filename string, flags *pflag.FlagSet) (*Config, error) {
|
|||||||
v.SetDefault("Log.Format", "console")
|
v.SetDefault("Log.Format", "console")
|
||||||
v.SetDefault("Log.Outputs", []string{"stderr"})
|
v.SetDefault("Log.Outputs", []string{"stderr"})
|
||||||
v.SetDefault("Log.Colors", true)
|
v.SetDefault("Log.Colors", true)
|
||||||
v.SetDefault("CORS.Allowed_Headers", []string{"*"})
|
|
||||||
v.SetDefault("CORS.Allowed_Hosts", []string{"*"})
|
v.SetDefault("CORS.Allowed_Hosts", []string{"*"})
|
||||||
v.SetDefault("CORS.Allowed_Methods", []string{"*"})
|
v.SetDefault("CORS.Allowed_Headers", []string{"Authorization", "Content-Type", "Depth", "Destination", "If", "Lock-Token", "Overwrite"})
|
||||||
|
v.SetDefault("CORS.Allowed_Methods", []string{"COPY", "DELETE", "GET", "HEAD", "LOCK", "MKCOL", "MOVE", "OPTIONS", "POST", "PROPFIND", "PROPPATCH", "PUT", "UNLOCK"})
|
||||||
|
|
||||||
// Read and unmarshal configuration
|
// Read and unmarshal configuration
|
||||||
err := v.ReadInConfig()
|
err := v.ReadInConfig()
|
||||||
|
|||||||
Reference in New Issue
Block a user