Handle sourceforge redirects with space in them
authorJamie Cameron <jcameron@webmin.com>
Sat, 25 Jul 2009 23:38:33 +0000 (16:38 -0700)
committerJamie Cameron <jcameron@webmin.com>
Sat, 25 Jul 2009 23:38:33 +0000 (16:38 -0700)
web-lib-funcs.pl

index f3d464e..bdbc93a 100755 (executable)
@@ -2084,6 +2084,10 @@ if ($rcode >= 300 && $rcode < 400) {
                if ($_[2]) { ${$_[2]} = "Missing Location header"; return; }
                else { &error("Missing Location header"); }
                }
+       my $params;
+       ($page, $params) = split(/\?/, $page);
+       $page =~ s/ /%20/g;
+       $page .= "?".$params if (defined($params));
        &http_download($host, $port, $page, $_[1], $_[2], $cbfunc, $ssl,
                       undef, undef, undef, $_[4], 0, $_[7]);
        }