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:
Mišo Belica 2021-08-31 21:37:56 +02:00 committed by GitHub
parent c5e3aef0a2
commit 54c1782640
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}
```
```