Skip to content

Commit

Permalink
Add missing CORS header in preflight response example (#32137)
Browse files Browse the repository at this point in the history
* Add missing CORS header in preflight response example

The example preflight request sends an `Access-Control-Request-Headers` header, but the example response does not contain an `Access-Control-Allow-Headers` which is required as per https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers . This PR simply adds one.

* Update index.md

---------

Co-authored-by: Hamish Willee <[email protected]>
  • Loading branch information
corgeman and hamishwillee authored Feb 11, 2024
1 parent 72ffc3a commit 9902715
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion files/en-us/glossary/preflight_request/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For example, a client might be asking a server if it would allow a {{HTTPMethod(
```http
OPTIONS /resource/foo
Access-Control-Request-Method: DELETE
Access-Control-Request-Headers: origin, x-requested-with
Access-Control-Request-Headers: Origin, X-Requested-With
Origin: https://foo.bar.org
```

Expand All @@ -28,6 +28,7 @@ HTTP/1.1 204 No Content
Connection: keep-alive
Access-Control-Allow-Origin: https://foo.bar.org
Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE
Access-Control-Allow-Headers: Origin, X-Requested-With
Access-Control-Max-Age: 86400
```

Expand Down

0 comments on commit 9902715

Please sign in to comment.