Skip to content

Commit

Permalink
set method to null if missing in $_SERVER
Browse files Browse the repository at this point in the history
fixes #18
  • Loading branch information
tacman authored Nov 19, 2024
1 parent 1ac9003 commit 4aafa55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/Partials/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Request extends Arrayable
*/
public function __construct()
{
$this->method = $_SERVER['REQUEST_METHOD'];
$this->method = $_SERVER['REQUEST_METHOD']??null;

$this->version = isset($_SERVER['SERVER_PROTOCOL'])
? \substr($_SERVER['SERVER_PROTOCOL'], \strpos($_SERVER['SERVER_PROTOCOL'], '/'))
Expand Down

0 comments on commit 4aafa55

Please sign in to comment.