add content-type

This commit is contained in:
DIYgod 2016-11-14 10:57:47 +08:00
parent fe53364920
commit a9750bdb9d
No known key found for this signature in database
GPG Key ID: F8797DD1088C6506
1 changed files with 1 additions and 0 deletions

View File

@ -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);