Skip to content

Commit 2621ab1

Browse files
committed
fix: patch up allowedHeaders
1 parent c6e249a commit 2621ab1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Cors.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Cors
1818
protected static $defaultConfig = [
1919
'origin' => '*',
2020
'methods' => 'GET,HEAD,PUT,PATCH,POST,DELETE',
21-
'headers' => '*',
21+
'allowedHeaders' => '*',
2222
'exposedHeaders' => '',
2323
'credentials' => false,
2424
'maxAge' => null,
@@ -79,7 +79,7 @@ protected static function configureOrigin()
7979

8080
protected static function configureHeaders()
8181
{
82-
$headers = static::$config['headers'];
82+
$headers = static::$config['allowedHeaders'];
8383

8484
if (!$headers) {
8585
// .headers wasn't specified, so reflect the request headers
@@ -127,7 +127,7 @@ protected static function configureCredentials()
127127
protected static function isOriginAllowed($allowedOrigin)
128128
{
129129
$origin = $_SERVER['HTTP_ORIGIN'] ?? $_SERVER['HTTP_HOST'];
130-
130+
131131
if (is_array($allowedOrigin)) {
132132
for ($i = 0; $i < count($allowedOrigin); $i++) {
133133
if (static::isOriginAllowed($allowedOrigin[$i])) {

0 commit comments

Comments
 (0)