From e97d2fb5178faceb5c94e400972a38f95c0fc2d7 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Sat, 1 Oct 2016 13:53:59 -0700 Subject: [PATCH] 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 --- pywb/static/wombat.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pywb/static/wombat.js b/pywb/static/wombat.js index ab2bd807..e97ffeaf 100644 --- a/pywb/static/wombat.js +++ b/pywb/static/wombat.js @@ -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; }