跳到主要内容
CNode

出现重定向循环怎么办?

社区
Gggaaooppeenngg发布于 13 年前最后回复 13 年前
274450
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)

B
brighthas#213 年前
var http = require('http');

http.createServer(function(req,res){
 res.writeHead(302,{
  'Location':'http://jsfuns.com'
 });
 res.end();
}).listen(3000,'127.0.0.1');
L
leizongmin#113 年前

电脑坏了

参与回复

登录后即可参与回复。登录