Skip to content

Commit edbfd50

Browse files
committed
wombat: fix rel '/' rewrite which incorrectly handles rel scheme '//' urls
1 parent 4c2e7b8 commit edbfd50

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pywb/static/wombat.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,12 @@ var wombat_internal = function($wbwindow) {
479479

480480
//Special case for href="." assignment
481481
if (prop == "href" && typeof(value) == "string") {
482-
if (value[0] == ".") {
483-
value = resolve_rel_url(value);
484-
} else if (value[0] == "/") {
485-
value = WB_wombat_location.origin + value;
482+
if (value) {
483+
if (value[0] == ".") {
484+
value = resolve_rel_url(value);
485+
} else if (value[0] == "/" && (value.length <= 1 || value[1] != "/")) {
486+
value = WB_wombat_location.origin + value;
487+
}
486488
}
487489
}
488490

0 commit comments

Comments
 (0)