From 81d8311995e716dd6c86ef55d1828a62b80e0ec3 Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Fri, 17 Apr 2020 16:46:15 +0200 Subject: [PATCH] wip --- app/Commands/ShareCommand.php | 1 + app/Server/Messages/TunnelMessage.php | 17 ++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Commands/ShareCommand.php b/app/Commands/ShareCommand.php index 80bc690..4609599 100644 --- a/app/Commands/ShareCommand.php +++ b/app/Commands/ShareCommand.php @@ -15,6 +15,7 @@ class ShareCommand extends Command public function handle() { + // TODO: Hacky workaround just to see if it works haha if ($this->option('auth')) { $GLOBALS['expose.auth'] = $this->option('auth'); } diff --git a/app/Server/Messages/TunnelMessage.php b/app/Server/Messages/TunnelMessage.php index d22cdb5..adb5541 100644 --- a/app/Server/Messages/TunnelMessage.php +++ b/app/Server/Messages/TunnelMessage.php @@ -35,16 +35,15 @@ class TunnelMessage implements Message public function respond() { - $clientConnection = $this->connectionManager->findConnectionForSubdomain($this->detectSubdomain()); - - if (is_null($clientConnection)) { -// $this->connection->send(\GuzzleHttp\Psr7\str(new Response(404, [], 'Not found'))); -// $this->connection->close(); -// dump("No clinet connection"); - return; - } - if ($this->hasBufferedAllData()) { + $clientConnection = $this->connectionManager->findConnectionForSubdomain($this->detectSubdomain()); + + if (is_null($clientConnection)) { + $this->connection->send(\GuzzleHttp\Psr7\str(new Response(404, [], 'Not found'))); + $this->connection->close(); + return; + } + $this->copyDataToClient($clientConnection); } }