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; } }