[BusyBox] wget redirect to other server (patch)
Glenn McGrath
bug1 at iinet.net.au
Sat Jan 17 23:12:44 UTC 2004
On Wed, 14 Jan 2004 22:26:55 +0100
Leif Lindholm <leif at smurfnet.nu> wrote:
> This patch fixes a bug (at least I think it is :) in wget, when using
> a http location header to redirect to a server other than the one the
> request was sent to.
>
> Please cc any replies since I'm not on the list.
Hi, thanks for the bug report and fix, ive applied a very slightly
modified version, i dont think we need to change anything if s[0]== '/'
if (strcasecmp(buf, "location") == 0) {
if (s[0] == '/')
target.path = bb_xstrdup(s+1);
else {
parse_url(bb_xstrdup(s), &target);
if (!proxy) {
server.host = target.host;
server.port = target.port;
}
bb_lookup_host(&s_in, server.host);
s_in.sin_port = server.port;
break;
}
}
Glenn
More information about the busybox
mailing list