Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Security/Listener/CorsSecurityListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ public function onKernelRequest(RequestEvent $event): void
return;
}

// If Origin header was the same as the request host, we can skip CORS validation
if ($request->headers->get('Origin') === $request->getSchemeAndHttpHost()) {
return;
}

// If the request has an Origin header and the CORS listener has not validated it, deny the request
if (
$request->headers->has('Origin')
Expand Down