From 21e88067cde4bc3c93b1d9484e77466e53317bca Mon Sep 17 00:00:00 2001 From: Haotong Lin Date: Wed, 16 Dec 2015 21:39:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D$=5FSERVER["HTTP=5FACCEPT"]?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6=E7=9A=84notice=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/controller/rest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/think/controller/rest.php b/library/think/controller/rest.php index ce9c7cf6..028be28c 100644 --- a/library/think/controller/rest.php +++ b/library/think/controller/rest.php @@ -102,6 +102,10 @@ abstract class rest */ public static function getAcceptType() { + if (!isset($_SERVER['HTTP_ACCEPT'])) { + return false; + } + $type = [ 'html' => 'text/html,application/xhtml+xml,*/*', 'xml' => 'application/xml,text/xml,application/x-xml', @@ -127,6 +131,7 @@ abstract class rest } } } + return false; } }