Skip to content

Commit

Permalink
fix: patch up allowedHeaders
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Sep 27, 2024
1 parent c6e249a commit 2621ab1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Cors.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Cors
protected static $defaultConfig = [
'origin' => '*',
'methods' => 'GET,HEAD,PUT,PATCH,POST,DELETE',
'headers' => '*',
'allowedHeaders' => '*',
'exposedHeaders' => '',
'credentials' => false,
'maxAge' => null,
Expand Down Expand Up @@ -79,7 +79,7 @@ protected static function configureOrigin()

protected static function configureHeaders()
{
$headers = static::$config['headers'];
$headers = static::$config['allowedHeaders'];

if (!$headers) {
// .headers wasn't specified, so reflect the request headers
Expand Down Expand Up @@ -127,7 +127,7 @@ protected static function configureCredentials()
protected static function isOriginAllowed($allowedOrigin)
{
$origin = $_SERVER['HTTP_ORIGIN'] ?? $_SERVER['HTTP_HOST'];

if (is_array($allowedOrigin)) {
for ($i = 0; $i < count($allowedOrigin); $i++) {
if (static::isOriginAllowed($allowedOrigin[$i])) {
Expand Down

0 comments on commit 2621ab1

Please sign in to comment.