mirror of
https://github.com/caddyserver/website.git
synced 2025-05-07 12:17:15 -04:00
Use correct response header in CORS example
`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
8a8b96dc86
commit
64ea0ec963
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