mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 12:36:16 -04:00
docs: Use correct response header in CORS example (#185)
`Access-Control-Request-Method` is a request header sent by the client (browser, ...) but we need to send response header with all allowed methods. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Method https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods
This commit is contained in:
parent
c5e3aef0a2
commit
54c1782640
1 changed files with 2 additions and 2 deletions
|
@ -32,10 +32,10 @@ Import a snippet that sets CORS headers using an import argument:
|
|||
(cors) {
|
||||
@origin header Origin {args.0}
|
||||
header @origin Access-Control-Allow-Origin "{args.0}"
|
||||
header @origin Access-Control-Request-Method GET
|
||||
header @origin Access-Control-Allow-Methods "OPTIONS,HEAD,GET,POST,PUT,PATCH,DELETE"
|
||||
}
|
||||
|
||||
example.com {
|
||||
import cors example.com
|
||||
}
|
||||
```
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue