Skip to content

Commit

Permalink
feat(Middleware): Handling multiple ip
Browse files Browse the repository at this point in the history
  • Loading branch information
Burial0268 committed Jul 11, 2023
1 parent 851464f commit 1b588c2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Middleware/ProcessIp.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
key: 'HTTP_X_FORWARDED_FOR',
default: Arr::get($request->getServerParams(), 'REMOTE_ADDR')
);

$ipAddress = explode(',',$ipAddress)[0];

return $handler->handle($request->withAttribute('ipAddress', $ipAddress));
}
Expand Down

0 comments on commit 1b588c2

Please sign in to comment.