From 07ec676e780ace8d359542d9dc79a93a96f25ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 21 Sep 2020 17:30:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Http/Request.php | 3 ++- HttpServer/Route/Router.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/HttpServer/Http/Request.php b/HttpServer/Http/Request.php index cb7a3e37..5cb691f5 100644 --- a/HttpServer/Http/Request.php +++ b/HttpServer/Http/Request.php @@ -321,7 +321,8 @@ class Request extends Application */ public function getMethod() { - $method = $this->headers->getHeader('request_method'); + $method = $this->headers->get('request_method'); + var_dump($this->headers); if (empty($method)) { return 'get'; } diff --git a/HttpServer/Route/Router.php b/HttpServer/Route/Router.php index 19db1283..2f9cf063 100644 --- a/HttpServer/Route/Router.php +++ b/HttpServer/Route/Router.php @@ -52,6 +52,7 @@ class Router extends Application implements RouterInterface */ public function addRoute($path, $handler, $method = 'any') { + $method = strtolower($method); if (!isset($this->nodes[$method])) { $this->nodes[$method] = []; }