Commit f7dfd968 authored by tufengqi's avatar tufengqi

修复header设置无效问题

parent 544d93fa
...@@ -137,7 +137,8 @@ class ResponseApi ...@@ -137,7 +137,8 @@ class ResponseApi
public static function header($key, $value) public static function header($key, $value)
{ {
if (1 != \Yii::$app->request->get('debug')) { if (1 != \Yii::$app->request->get('debug')) {
header($key . ': ' . $value); \Yii::$app->response->format = Response::FORMAT_RAW;
\Yii::$app->response->headers->add($key, $value);
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment