From edbfd500a4fe072d4b05cdc143772871711b4e8e Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Mon, 12 Oct 2015 22:05:24 -0700 Subject: [PATCH] wombat: fix rel '/' rewrite which incorrectly handles rel scheme '//' urls --- pywb/static/wombat.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pywb/static/wombat.js b/pywb/static/wombat.js index d467b47f..40383588 100644 --- a/pywb/static/wombat.js +++ b/pywb/static/wombat.js @@ -479,10 +479,12 @@ var wombat_internal = function($wbwindow) { //Special case for href="." assignment if (prop == "href" && typeof(value) == "string") { - if (value[0] == ".") { - value = resolve_rel_url(value); - } else if (value[0] == "/") { - value = WB_wombat_location.origin + value; + if (value) { + if (value[0] == ".") { + value = resolve_rel_url(value); + } else if (value[0] == "/" && (value.length <= 1 || value[1] != "/")) { + value = WB_wombat_location.origin + value; + } } }