1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

wombat unrewrite: if given a host-relative url (starting with '/') to extract_orig(), extract as host-relative as well if the host matches the current origin -- maintain host-relative urls when possible

This commit is contained in:
Ilya Kreymer 2016-10-01 13:53:59 -07:00
parent 950c31737c
commit e97d2fb517

View File

@ -359,10 +359,9 @@ var wombat_internal = function($wbwindow) {
}
}
// remove trailing slash
//if (ends_with(href, "/")) {
// href = href.substring(0, href.length - 1);
//}
if (orig_href.charAt(0) == "/" && orig_href.charAt(1) != "/" && starts_with(href, wb_orig_origin)) {
href = href.substr(wb_orig_origin.length);
}
return href;
}