From 833fcaf0f29f23bdceaae655f64d10c18b9bf562 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 2 Jul 2018 13:29:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bswoole=E7=9A=84method?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index 91d10da3e2..3b6c984ac0 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -783,7 +783,7 @@ public function method($origin = false) { if ($origin) { // 获取原始请求类型 - return $this->isCli() ? 'GET' : $this->server('REQUEST_METHOD'); + return $this->server('REQUEST_METHOD') ?: 'GET'; } elseif (!$this->method) { if (isset($_POST[$this->config['var_method']])) { $this->method = strtoupper($_POST[$this->config['var_method']]); @@ -792,7 +792,7 @@ public function method($origin = false) } elseif ($this->server('HTTP_X_HTTP_METHOD_OVERRIDE')) { $this->method = strtoupper($this->server('HTTP_X_HTTP_METHOD_OVERRIDE')); } else { - $this->method = $this->isCli() ? 'GET' : $this->server('REQUEST_METHOD'); + $this->method = $this->server('REQUEST_METHOD') ?: 'GET'; } }