add: .gitignore | fix: api.core.Request (InvalidHttpError if not in **AND** not in @forced_method)

This commit is contained in:
xdrm-brackets 2017-11-27 14:57:29 +01:00
parent 3fe0b7590a
commit b706948b3a
2 changed files with 3 additions and 1 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/node_modules
/.vscode

View File

@ -103,7 +103,7 @@
$params = (is_array($params)) ? $params : []; $params = (is_array($params)) ? $params : [];
/* (3) On définit en constante la méthode HTTP */ /* (3) On définit en constante la méthode HTTP */
if( !isset($_SERVER['REQUEST_METHOD']) || !is_string($forced_method) ) if( !isset($_SERVER['REQUEST_METHOD']) && !is_string($forced_method) )
return $this->error->set(Err::UnknownHttpMethod); return $this->error->set(Err::UnknownHttpMethod);
$this->http_method = is_string($forced_method) ? strtoupper($forced_method) : strtoupper($_SERVER['REQUEST_METHOD']); $this->http_method = is_string($forced_method) ? strtoupper($forced_method) : strtoupper($_SERVER['REQUEST_METHOD']);