mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
Remove subdomain reserve check from server
This commit is contained in:
@@ -107,7 +107,7 @@ class Client
|
||||
|
||||
$connection->on('authenticated', function ($data) use ($deferred, $sharedUrl) {
|
||||
$httpProtocol = $this->configuration->port() === 443 ? 'https' : 'http';
|
||||
$host = $data->server_host;
|
||||
$host = $data->server_host ?? $this->configuration->host();
|
||||
|
||||
$this->logger->info($data->message);
|
||||
$this->logger->info("Local-URL:\t\t{$sharedUrl}");
|
||||
@@ -116,7 +116,7 @@ class Client
|
||||
$this->logger->info("Expose-URL:\t\thttps://{$data->subdomain}.{$host}");
|
||||
$this->logger->line('');
|
||||
|
||||
static::$subdomains[] = "{$httpProtocol}://{$data->subdomain}.{$data->server_host}";
|
||||
static::$subdomains[] = "{$httpProtocol}://{$data->subdomain}.{$host}";
|
||||
|
||||
$deferred->resolve($data);
|
||||
});
|
||||
|
||||
@@ -77,12 +77,6 @@ class StoreSubdomainController extends AdminController
|
||||
$this->subdomainRepository
|
||||
->storeSubdomain($insertData)
|
||||
->then(function ($subdomain) use ($httpConnection) {
|
||||
if (is_null($subdomain)) {
|
||||
$httpConnection->send(respond_json(['error' => 'The subdomain is already taken.'], 422));
|
||||
$httpConnection->close();
|
||||
|
||||
return;
|
||||
}
|
||||
$httpConnection->send(respond_json(['subdomain' => $subdomain], 200));
|
||||
$httpConnection->close();
|
||||
});
|
||||
|
||||
@@ -79,7 +79,7 @@ class TunnelMessageController extends Controller
|
||||
|
||||
protected function detectServerHost(Request $request): ?string
|
||||
{
|
||||
return Str::after($request->header('Host'), '.');
|
||||
return Str::before(Str::after($request->header('Host'), '.'), ':');
|
||||
}
|
||||
|
||||
protected function sendRequestToClient(Request $request, ControlConnection $controlConnection, ConnectionInterface $httpConnection)
|
||||
|
||||
Reference in New Issue
Block a user