Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
Dont merge config, use blank defaults
Browse files Browse the repository at this point in the history
Fixes #181
  • Loading branch information
barryvdh authored Mar 22, 2017
1 parent d989d47 commit 0b75818
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/CorsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ public function __construct(array $options = array())

private function normalizeOptions(array $options = array())
{
// Set defaults from the config file
$options += require __DIR__ .'/../config/cors.php';
$options += array(
'allowedOrigins' => array(),
'supportsCredentials' => false,
'allowedHeaders' => array(),
'exposedHeaders' => array(),
'allowedMethods' => array(),
'maxAge' => 0,
);

// normalize array('*') to true
if ($options['allowedOrigins'] === true || in_array('*', $options['allowedOrigins'])) {
Expand Down

0 comments on commit 0b75818

Please sign in to comment.