0
我在Heroku上托管一个站点并利用其背负式SSL。Expressjs res.redirect(...)将内容类型从json更改为表单urlencoded
实施SSL某条线路,我使用此代码:
app.all('/user/*', function(req, res, next) {
if(app.settings.env != "development" &&
req.headers['x-forwarded-proto'] != 'https') {
res.redirect('https://' + req.header('host') + req.url);
} else {
next();
}
});
重定向工作正常,所有的标题都存在。但是,内容类型从application/json更改为application/x-www-form-urlencoded。
有谁知道这种行为是有意的还是它的错误?有什么我需要做的,以阻止内容类型改变?
感谢