Skip to content
Snippets Groups Projects
Commit 28ad16e0 authored by echicken's avatar echicken :chicken:
Browse files

Sub in original scheme://host[:port] if absent from Location on redirect.

parent dd7df94b
No related branches found
No related tags found
No related merge requests found
......@@ -220,7 +220,10 @@ HTTPRequest.prototype.Get=function(url, referer, base) {
&& this.response_headers_parsed.Location.length
) {
this.follow_redirects--;
return this.Get(this.response_headers_parsed.Location[0], url); // To-do: be less tired and think about referer,base
const re = /([a-z]+:\/\/.+:{0,1}\d{0,5})\//i;
var loc = this.response_headers_parsed.Location[0];
if (loc.search(re) < 0) loc = url.match(re)[1] + loc; // Assumes 'url' will match 're', but if it doesn't you'll have other problems anyway
return this.Get(loc, url); // To-do: be less tired and think about referer,base
}
return(this.body);
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment