0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

CORSヘッダまとめ

Last updated at Posted at 2022-10-22

レスポンスのヘッダ(サーバが送る)

ヘッダ名 プリフライト 本リクエスト 説明
Access-Control-Allow-Credentials YES YES クレデンシャル(クッキーの送信、BASIC認証を許可するか)。これをtrueにすると、Access-Control-Allow-Originでワイルドカードを使えなくなる
Access-Control-Allow-Headers YES no 本リクエストに含めることを許可するヘッダ
Access-Control-Allow-Methods YES no 本リクエストで許可するメソッド
Access-Control-Allow-Origin YES YES リクエスト元のOrigin。カンマ区切りで複数指定はできない
Access-Control-Expose-Headers no YES ブラウザのJavaScriptが読み取ることを許可するレスポンスヘッダ
Access-Control-Max-Age YES no プリフライトを何秒キャッシュして良いか

リクエストのヘッダ(クライアントが送る)

ヘッダ名 プリフライト  本リクエスト 説明
Access-Control-Request-Method YES no 本リクエストのメソッド
Access-Control-Request-Headers YES no  本リクエストのヘッダ
Origin YES YES オリジン

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?