From b706948b3a01d79787426e2b7f24a5f5693e59d3 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 27 Nov 2017 14:57:29 +0100 Subject: [PATCH] add: .gitignore | fix: api.core.Request (InvalidHttpError if not in **AND** not in @forced_method) --- .gitignore | 2 ++ build/api/core/Request.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a22d218 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/node_modules +/.vscode \ No newline at end of file diff --git a/build/api/core/Request.php b/build/api/core/Request.php index 7ed7e83..efc3f4f 100755 --- a/build/api/core/Request.php +++ b/build/api/core/Request.php @@ -103,7 +103,7 @@ $params = (is_array($params)) ? $params : []; /* (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); $this->http_method = is_string($forced_method) ? strtoupper($forced_method) : strtoupper($_SERVER['REQUEST_METHOD']);