我最近读到了这段代码:
res.location('/'); res.redirect('/');
我甚至不知道为什么要用res.location?
发布于 2020-04-25 19:06:37
res.location只是设置响应头。
res.location
另一方面,res.redirect将状态设置为302。
res.redirect
请看the source中的区别。
https://stackoverflow.com/questions/61424625
相似问题