Skip to content

Commit ce37dbe

Browse files
committed
feat: allow wildcard origin in CORS middleware for better flexibility
1 parent 51d99dc commit ce37dbe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Http/Middlewares/CorsMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function handle(Request $request, Closure $next): Response
4242
*/
4343
private function getAllowedOrigin(Request $request): string
4444
{
45-
$origin = $request->headers->get('Origin');
45+
$origin = $request->headers->get('Origin') ?? '*';
4646

4747
// Get environment-specific configurations
4848
$allowedOrigins = $this->getAllowedOrigins();

0 commit comments

Comments
 (0)