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

Commit

Permalink
fix: Fixed bug 1
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Mar 14, 2018
1 parent e10154b commit bd965dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
17 changes: 1 addition & 16 deletions src/Laravel/Providers/LaravelServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class LaravelServiceProvider extends ServiceProvider
*
* @author Seven Du <[email protected]>
*/
protected $defer = true;
protected $defer = false;

/**
* Bootstrap the CORS service provider.
Expand Down Expand Up @@ -57,7 +57,6 @@ public function register()
$this->mergeConfigFrom(__DIR__.'/../../../config/cors.php', 'cors');

// Register the CORS server instance alias.
$this->app->alias(CorsInterface::class, CorsInterface::class);
$this->app->alias(CorsInterface::class, Cors::class);

// Register CORS servise singleton.
Expand All @@ -68,18 +67,4 @@ public function register()
return new Cors($config);
});
}

/**
* Get the services provided by the provider.
*
* @return array
*
* @author Seven Du <[email protected]>
*/
public function providers()
{
return [
CorsInterface::class, Cors::class,
];
}
}
2 changes: 1 addition & 1 deletion src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(string $type, $request = null)
$this->request = $request;

// $request not is framework interface, using global veriable $_REQUEST
if ($this->type === 'array' || !$response || is_array($response)) {
if ($this->type === 'array' || !$request || is_array($request)) {
$this->request = array_merge($_REQUEST, (array) $request);
$this->type = 'array';
}
Expand Down

0 comments on commit bd965dd

Please sign in to comment.