From d4a6d504b161f03908479a96c9815407eaae753c Mon Sep 17 00:00:00 2001 From: Matheus Date: Sat, 10 Nov 2018 22:16:45 -0200 Subject: [PATCH] Set HTTP method before initializing InputHandler This is needed because without it the InputHandler doesn't know which http method is being used, and because of that it can't parse the body of a PUT request --- src/Pecee/Http/Request.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Pecee/Http/Request.php b/src/Pecee/Http/Request.php index cf7cc32..31dc0ae 100644 --- a/src/Pecee/Http/Request.php +++ b/src/Pecee/Http/Request.php @@ -84,7 +84,8 @@ class Request // Check if special IIS header exist, otherwise use default. $this->setUrl(new Url($this->getHeader('unencoded-url', $this->getHeader('request-uri')))); - + + $this->method = strtolower($this->getHeader('request-method')); $this->inputHandler = new InputHandler($this); $this->method = strtolower($this->inputHandler->value('_method', $this->getHeader('request-method'))); } @@ -425,4 +426,4 @@ class Request return $this->data[$name] ?? null; } -} \ No newline at end of file +}