REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 3.04 KB
Close
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustHosts.php
Text
Base64
<?php namespace Illuminate\Http\Middleware; use Illuminate\Contracts\Foundation\Application; use Illuminate\Http\Request; class TrustHosts { /** * The application instance. * * @var \Illuminate\Contracts\Foundation\Application */ protected $app; /** * The trusted hosts that have been configured to always be trusted. * * @var array<int, string>|(callable(): array<int, string>)|null */ protected static $alwaysTrust; /** * Indicates whether subdomains of the application URL should be trusted. * * @var bool|null */ protected static $subdomains; /** * Create a new middleware instance. * * @param \Illuminate\Contracts\Foundation\Application $app * @return void */ public function __construct(Application $app) { $this->app = $app; } /** * Get the host patterns that should be trusted. * * @return array */ public function hosts() { if (is_null(static::$alwaysTrust)) { return [$this->allSubdomainsOfApplicationUrl()]; } $hosts = match (true) { is_array(static::$alwaysTrust) => static::$alwaysTrust, is_callable(static::$alwaysTrust) => call_user_func(static::$alwaysTrust), default => [], }; if (static::$subdomains) { $hosts[] = $this->allSubdomainsOfApplicationUrl(); } return $hosts; } /** * Handle the incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return \Illuminate\Http\Response */ public function handle(Request $request, $next) { if ($this->shouldSpecifyTrustedHosts()) { Request::setTrustedHosts(array_filter($this->hosts())); } return $next($request); } /** * Specify the hosts that should always be trusted. * * @param array<int, string>|(callable(): array<int, string>) $hosts * @param bool $subdomains * @return void */ public static function at(array|callable $hosts, bool $subdomains = true) { static::$alwaysTrust = $hosts; static::$subdomains = $subdomains; } /** * Determine if the application should specify trusted hosts. * * @return bool */ protected function shouldSpecifyTrustedHosts() { return ! $this->app->environment('local') && ! $this->app->runningUnitTests(); } /** * Get a regular expression matching the application URL and all of its subdomains. * * @return string|null */ protected function allSubdomainsOfApplicationUrl() { if ($host = parse_url($this->app['config']->get('app.url'), PHP_URL_HOST)) { return '^(.+\.)?'.preg_quote($host).'$'; } } /** * Flush the state of the middleware. * * @return void */ public static function flushState() { static::$alwaysTrust = null; static::$subdomains = null; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 8
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AddLinkHeadersForPreloadedAssets.php
816 B
lrw-rw-rw-
2025-09-17 06:53:03
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CheckResponseForModifications.php
539 B
lrw-rw-rw-
2025-09-17 06:53:03
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
FrameGuard.php
499 B
lrw-rw-rw-
2025-09-17 06:53:03
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
HandleCors.php
2.69 KB
lrw-rw-rw-
2025-09-17 06:53:03
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SetCacheHeaders.php
2.81 KB
lrw-rw-rw-
2025-09-17 06:53:03
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TrustHosts.php
3.04 KB
lrw-rw-rw-
2025-09-17 06:53:03
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
TrustProxies.php
5.49 KB
lrw-rw-rw-
2025-09-17 06:53:03
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ValidatePostSize.php
1.21 KB
lrw-rw-rw-
2025-09-17 06:53:03
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).