Skip to content

Commit

Permalink
feat: updated cors
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Apr 10, 2023
1 parent 61fef6b commit 88f77a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/Middleware/CorsMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ final class CorsMiddleware implements MiddlewareInterface
public function handle(Request $request, Closure $next)
{
header('Access-Control-Allow-Origin: ' . baseurl());
header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization');
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization, Token');
header('Origin: ' . baseurl());
header('Vary: Accept-Encoding, Origin');

if ($request->method() != 'OPTIONS') {
return $next($request);
Expand Down

0 comments on commit 88f77a8

Please sign in to comment.