mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 16:54:05 +00:00
Adds ability for origin to contain ports
This commit is contained in:
parent
b4182f8194
commit
605e6d0bb5
1 changed files with 5 additions and 1 deletions
|
|
@ -42,7 +42,11 @@ class InitializeTenancyByRequestOrigin extends IdentificationMiddleware
|
||||||
{
|
{
|
||||||
$tenant = null;
|
$tenant = null;
|
||||||
if ($request->hasHeader('origin')) {
|
if ($request->hasHeader('origin')) {
|
||||||
$tenant = optional(parse_url($request->headers->get('origin')))['host'];
|
$parts = parse_url($request->headers->get('origin'));
|
||||||
|
$tenant = optional($parts)['host'];
|
||||||
|
if (array_key_exists('port', $parts) && $tenant) {
|
||||||
|
$tenant .= ":{$parts['port']}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $tenant;
|
return $tenant;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue