feat(BREAKING): extend cors functionality (#25)

This commit is contained in:
Steven Vandevelde
2019-06-11 13:02:10 +01:00
committed by Henrique Dias
parent 764a69cd33
commit 7358553e69
3 changed files with 82 additions and 31 deletions
+18 -2
View File
@@ -28,8 +28,17 @@ rules: []
# CORS configuration
cors:
- enabled: false
allowed_hosts: []
enabled: true
credentials: true
allowed_headers:
- Depth
allowed_hosts:
- http://localhost:8080
allowed_methods:
- GET
exposed_headers:
- Content-Length
- Content-Range
users:
- username: admin
@@ -54,6 +63,13 @@ There are more ways to customize how you run WebDAV through flags and environmen
An example of how to use this with `systemd` is on [webdav.service.example](/webdav.service.example).
### CORS
The `allowed_*` properties are optional, the default value for each of them will be `*`. `exposed_headers` is optional as well, but is not set if not defined. Setting `credentials` to `true` will allow you to:
1. Use `withCredentials = true` in javascript.
2. Use the `username:password@host` syntax.
## License
MIT © [Henrique Dias](https://hacdias.com)