出现重定向循环怎么办?
发布于 11 年前 作者 ggaaooppeenngg 6643 次浏览 最后一次编辑是 8 年前
var http = require('http');

http.createServer(function(req,res){
 res.writeHead(301,{
  'Location':'http://baidu.com'
 });
 res.end();
}).listen(3000,'127.0.0.1');

访问的URL 是127.0.0.1:3000//www.baidu.com 这是为什么?

2 回复
var http = require('http');

http.createServer(function(req,res){
 res.writeHead(302,{
  'Location':'http://jsfuns.com'
 });
 res.end();
}).listen(3000,'127.0.0.1');
回到顶部