fix pargar bugs 2
This commit is contained in:
@@ -74,7 +74,7 @@ class WebsocketBroadcastService
|
||||
}
|
||||
|
||||
$body = array_merge($payload, ['trigger' => $trigger]);
|
||||
$host = $this->resolveHost();
|
||||
$host = app(ConfigService::class)->resolvePublicHost();
|
||||
if ($host !== '') {
|
||||
$body['host'] = $host;
|
||||
}
|
||||
@@ -103,31 +103,4 @@ class WebsocketBroadcastService
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
private function resolveHost(): string
|
||||
{
|
||||
$config = app(ConfigService::class);
|
||||
|
||||
$appUrl = trim($config->getString('app_url', ''));
|
||||
if ($appUrl !== '') {
|
||||
$host = parse_url($appUrl, PHP_URL_HOST);
|
||||
if (is_string($host) && $host !== '') {
|
||||
return $host;
|
||||
}
|
||||
}
|
||||
|
||||
if (! app()->runningInConsole() && request()) {
|
||||
$requestHost = trim((string) request()->getHost());
|
||||
if ($requestHost !== '') {
|
||||
return $requestHost;
|
||||
}
|
||||
}
|
||||
|
||||
$nameEn = trim((string) $config->getString('name_en', ''));
|
||||
if ($nameEn !== '') {
|
||||
return $nameEn;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user