my.origin1/myendpoint
重定向到另一个端点:
router.get('/myendpoint', {
var param = this.query.myParam;
this.redirect(`http://my.origin2/myotherendpoint?param=${param}`);
console.log(JSON.stringify(this.request.header,undefined,2));
})
{
"location": "http://my.origin2/myotherendpoint?param=myParamValue",
"content-type": "text/html; charset=utf-8",
"content-length": "whatever"
}
然而,重定向请求得到一个404,当我在fiddler中观察到它时,我看到位置标头
my.origin1/myotherendpoint?param=myParamValue
我浏览了代码,没有任何中间件拦截请求,我还检查了我们的IIS设置,没有url重定向可能会影响这一点。