Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
convert request to lumen request
Browse files Browse the repository at this point in the history
  • Loading branch information
edricwilliem committed Mar 23, 2022
1 parent b9b766a commit 1105f31
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Server/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use SwooleTW\Http\Concerns\InteractsWithSwooleQueue;
use SwooleTW\Http\Concerns\InteractsWithSwooleTable;
use Symfony\Component\ErrorHandler\Error\FatalError;
use Laravel\Lumen\Http\Request as LumenRequest;

/**
* Class Manager
Expand Down Expand Up @@ -215,6 +216,10 @@ public function onRequest($swooleRequest, $swooleResponse)
// transform swoole request to illuminate request
$illuminateRequest = Request::make($swooleRequest)->toIlluminate();

if (!$sandbox->isLaravel()) { // is lumen app
$illuminateRequest = LumenRequest::createFromBase($illuminateRequest);
}

// set current request to sandbox
$sandbox->setRequest($illuminateRequest);

Expand Down

0 comments on commit 1105f31

Please sign in to comment.