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

wombat cookie: remove domain for now (needs further rewriting to be added)

This commit is contained in:
Ilya Kreymer 2015-07-13 12:23:18 -07:00
parent 6e929aabdf
commit 1911347f04

View File

@ -1353,6 +1353,7 @@ var wombat_internal = function(window) {
function init_cookies_override(window)
{
var cookie_path_regex = /\bPath=\'?\"?([^;'"\s]+)/i;
var cookie_domain_regex = /\bDomain=([^;'"\s]+)/i;
var orig_get_cookie = get_orig_getter(document, "cookie");
var orig_set_cookie = get_orig_setter(document, "cookie");
@ -1367,6 +1368,13 @@ var wombat_internal = function(window) {
value = value.replace(matched[1], rewritten);
}
matched = value.match(cookie_domain_regex);
if (matched) {
value = value.replace(matched[0], "");
}
value = value.replace("secure", "");
return orig_set_cookie.call(this, value);
}