Skip to content

Commit

Permalink
Set the IP when null to fix usage with trusted proxies (#146)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonas Siewertsen <mail@jonassiewertsen.com>
Co-authored-by: jasonvarga <jasonvarga@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 22, 2023
1 parent 23543aa commit 4412cd7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Commands/StaticSiteServe.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\Process;

use function Termwind\terminal;

class StaticSiteServe extends Command
Expand Down
4 changes: 4 additions & 0 deletions src/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public function site()

public function toResponse($request)
{
if (is_null($request->ip())) {
$request->server->add(['REMOTE_ADDR' => '0.0.0.0']);
}

$kernel = app(Kernel::class);
$response = $kernel->handle($request);
$kernel->terminate($request, $response);
Expand Down

0 comments on commit 4412cd7

Please sign in to comment.