Skip to content

Commit

Permalink
Allow all valid HTTP Methods
Browse files Browse the repository at this point in the history
Deprecated $validMethods and allowed all valid HTTP methods
  • Loading branch information
mathmarques committed Mar 21, 2017
1 parent 105b56c commit c5dcaf4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Slim/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class Request extends Message implements ServerRequestInterface
* Valid request methods
*
* @var string[]
* @deprecated
*/
protected $validMethods = [
'CONNECT' => 1,
Expand Down Expand Up @@ -349,7 +350,7 @@ protected function filterMethod($method)
}

$method = strtoupper($method);
if (!isset($this->validMethods[$method])) {
if (preg_match("/^[!#$%&'*+.^_`|~0-9a-z-]+$/i", $method) !== 1) {
throw new InvalidMethodException($this, $method);
}

Expand Down

0 comments on commit c5dcaf4

Please sign in to comment.