Skip to content

Commit d96607a

Browse files
authored
Merge pull request #21 from fulll/hotfix-listener
2 parents 96e41af + 36c6041 commit d96607a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Security/Listener/CorsSecurityListener.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ public function onKernelRequest(RequestEvent $event): void
4343
return;
4444
}
4545

46+
// If Origin header was the same as the request host, we can skip CORS validation
47+
if ($request->headers->get('Origin') === $request->getSchemeAndHttpHost()) {
48+
return;
49+
}
50+
4651
// If the request has an Origin header and the CORS listener has not validated it, deny the request
4752
if (
4853
$request->headers->has('Origin')

0 commit comments

Comments
 (0)