Skip to content

Commit

Permalink
[4.x] Fix telescope.domain usage. (laravel#1124)
Browse files Browse the repository at this point in the history
  • Loading branch information
finagin authored Sep 9, 2021
1 parent e82daf6 commit 95631f9
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/Telescope.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,21 @@ protected static function handlingApprovedRequest($app)
return false;
}

return static::requestIsToApprovedUri($app['request']);
return static::requestIsToApprovedDomain($app['request'])
|| static::requestIsToApprovedUri($app['request']);
}

/**
* Determine if the request is to an approved domain.
*
* @param \Illuminate\Http\Request $request
* @return bool
*/
protected static function requestIsToApprovedDomain($request): bool
{
$currentHost = $request->getHost();

return config('telescope.domain', $currentHost) !== $currentHost;
}

/**
Expand Down

0 comments on commit 95631f9

Please sign in to comment.