LoginSignup
3
1

More than 3 years have passed since last update.

barryvdh/laravel-cors の allowedOriginsPatterns オプション

Posted at

barryvdh/laravel-cors については、以下記事に詳しい。

で、実際に使ったとき、allowedOriginsPatterns オプションに
どんな文字列を具体的に渡せばいいかわからなかったので
該当ライブラリのソースコード調べた時のメモ。

  • 書式は、preg_match() の第1引数に書く形式で。デリミタも必要。
  • allowedOriginsPatterns は配列なので、複数正規表現パターンの指定が可能。

ちなみに、これを処理しているのは、barryvdh/laravel-cors が依存しているライブラリ
asm89/stack-cors の
src/Asm89/Stack/CorsService.php checkOrigin() メソッド。

3
1
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
3
1