CNode

出现重定向循环怎么办?

Gggaaooppeenngg发布于13 年前最后回复13 年前2 回复7398 浏览0 收藏
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)

L
leizongmin#1·13 年前

电脑坏了

B
brighthas#2·13 年前
var http = require('http');

http.createServer(function(req,res){
 res.writeHead(302,{
  'Location':'http://jsfuns.com'
 });
 res.end();
}).listen(3000,'127.0.0.1');
参与回复
登录后即可参与回复。登录