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

Commit

Permalink
chore: ⚠️Preflight response statuc code using 204
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Apr 9, 2018
1 parent 6b6987d commit 3457188
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Laravel/Middleware/Cors.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public function handle($request, Closure $next)
} elseif ($this->cors->isPreflightRequest($type, $request)) {
$this->corsHandle($request, $response = new Response());

// Set Preflight response status code.
$response->setStatusCode(204);

return $response;

// Add the headers on the Request Handled event as fallback in case of exceptions
Expand Down
3 changes: 3 additions & 0 deletions src/Lumen/Middleware/Cors.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ public function handle($request, Closure $next)
$this->cors->setResponse($type, $response = new Response());
$this->cors->handle();

// Set Preflight response status code.
$response->setStatusCode(204);

return $response;
}

Expand Down

0 comments on commit 3457188

Please sign in to comment.