wesmiler 5 лет назад
Родитель
Сommit
dd583c140b
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      app/Exception/Handler/AppExceptionHandler.php

+ 1 - 1
app/Exception/Handler/AppExceptionHandler.php

@@ -44,7 +44,7 @@ class AppExceptionHandler extends ExceptionHandler
 
             // 阻止异常冒泡
             $this->stopPropagation();
-            return $response->withBody(new SwooleStream($data));
+            return $response->withHeader('Server', 'Hyperf')->withStatus(401)->withBody(new SwooleStream($data));
         }
 
         $this->logger->error(sprintf('%s[%s] in %s', $throwable->getMessage(), $throwable->getLine(), $throwable->getFile()));