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

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

@@ -44,8 +44,8 @@ class AppExceptionHandler extends ExceptionHandler
 
             // 阻止异常冒泡
             $this->stopPropagation();
-            return $response->withHeader('Server', 'Hyperf')
-                ->withHeader('charset','utf-8')
+            return $response->withHeader('Server', 'hcbet')
+                ->withHeader('Content-Type','application/json')
                 ->withStatus(401)
                 ->withBody(new SwooleStream($data));
         }
@@ -53,7 +53,7 @@ class AppExceptionHandler extends ExceptionHandler
         $this->logger->error(sprintf('%s[%s] in %s', $throwable->getMessage(), $throwable->getLine(), $throwable->getFile()));
         $this->logger->error($throwable->getTraceAsString());
 
-        return $response->withHeader('Server', 'Hyperf')->withStatus(500)->withBody(new SwooleStream('Internal Server Error.'));
+        return $response->withHeader('Server', 'hcbet')->withStatus(500)->withBody(new SwooleStream('Internal Server Error.'));
     }
 
     public function isValid(Throwable $throwable): bool