【发布时间】:2017-11-26 17:09:21
【问题描述】:
得到这个奇怪的
这是 express.js 中的 post call,其中包含重定向。
app.post('/callback', (req, res)=> {
res.redirect('/deal')
});
这是我在 express.js 中的调用
app.get('/deal', (req, res) => {
console.log("node.js /deal")
});
以上工作正常
更新: 真正的麻烦。
快递:
app.post('/callback', (req, res)=> {
res.redirect('')
});
angular2-cli:
path: '',
redirectTo: '/deals'
component: PublicDealsComponent
为什么我说奇怪的是它在 Microsoft-edge 中完美运行,但在 chrome 中却不行。是什么原因?如何让它在 chrome 中工作?
【问题讨论】:
-
你在控制台得到什么输出?
-
在网络面板中签入时,响应标头看起来都正常?
-
@professionallyme86 你能看看更新一。在此,控制台中没有输出(empty)。
-
@CBroe 看起来不错(并且看起来与 microsoft-edge 相同)。常规:请求 URL:localhost:3000/callback 请求方法:POST 状态代码:302 找到(黄色)远程地址:[::1]:3000 推荐人策略:no-referrer-when-downgrade
-
是的,我可以在最后重现这个问题。这是因为您试图重定向到空字符串。
标签: javascript node.js google-chrome express redirect