Merge branch 'master' of github.com:beyondcode/phunnel

This commit is contained in:
Marcel Pociot committed 2021-06-11 12:54:44 +02:00
commit 21a9117dd6
1 file changed
+4
@@ -70,6 +70,10 @@ class TunnelMessageController extends Controller
protected function detectSubdomain(Request $request): ?string protected function detectSubdomain(Request $request): ?string
{ {
if (substr_count($request->header('Host'), '.') === 1) {
return null;
}
$subdomain = Str::before($request->header('Host'), '.'); $subdomain = Str::before($request->header('Host'), '.');
return $subdomain === $request->header('Host') ? null : $subdomain; return $subdomain === $request->header('Host') ? null : $subdomain;