我打開了兩個端口:3000 和 4000。我想從 3000 傳遞授權(quán)標(biāo)頭并在端口 4000 上接收它。我正在從 3000 端口傳遞授權(quán)值app.get('/',function(req,res){ console.log('redirect'); res.header('Authorization', 'my sample'); res.redirect('http://localhost:4000/api/oauth2');});在 4000 端口上接收app.get('/api/oauth2', (req, res)=> { console.log(req.headers.authorization); // undefined res.end('i reached');})我如何從 3000 到 4000 端口接收這個值?
Express js 授權(quán)值未定義
泛舟湖上清波郎朗
2021-11-18 20:45:33