1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-31 03:04:12 +02:00

wombat: fix rel '/' rewrite which incorrectly handles rel scheme '//' urls

This commit is contained in:
Ilya Kreymer 2015-10-12 22:05:24 -07:00
parent 4c2e7b89b6
commit edbfd500a4

View File

@ -479,12 +479,14 @@ var wombat_internal = function($wbwindow) {
//Special case for href="." assignment //Special case for href="." assignment
if (prop == "href" && typeof(value) == "string") { if (prop == "href" && typeof(value) == "string") {
if (value) {
if (value[0] == ".") { if (value[0] == ".") {
value = resolve_rel_url(value); value = resolve_rel_url(value);
} else if (value[0] == "/") { } else if (value[0] == "/" && (value.length <= 1 || value[1] != "/")) {
value = WB_wombat_location.origin + value; value = WB_wombat_location.origin + value;
} }
} }
}
try { try {
this._parser[prop] = value; this._parser[prop] = value;