瀏覽代碼

add content-type

DIYgod 8 年之前
父節點
當前提交
a9750bdb9d
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      nodejs/routes/all.js

+ 1 - 0
nodejs/routes/all.js

@@ -2,6 +2,7 @@ module.exports = function(req, res, next) {
     res.header('Access-Control-Allow-Origin', '*');
     res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild');
     res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
+    res.header('content-type', 'application/json; charset=utf-8');
 
     if (req.method == 'OPTIONS') {
         res.send(200);