1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 17:24:03 +00:00

fix origin identification: parse hostname when full URL is used

This commit is contained in:
Samuel Štancl 2025-07-14 21:44:12 +02:00
parent d8af9b4b43
commit 91295f01e2
2 changed files with 11 additions and 1 deletions

View file

@ -10,6 +10,10 @@ class InitializeTenancyByOriginHeader extends InitializeTenancyByDomainOrSubdoma
{
public function getDomain(Request $request): string
{
return $request->header('Origin', '');
if ($origin = $request->header('Origin', '')) {
return parse_url($origin, PHP_URL_HOST) ?? $origin;
}
return '';
}
}