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

bump to 0.10.7-dev

wombat: use Document.prototpe for cookie getter and setter if not found on
document object, add no-op setter for document.domain
tests: fix test to avoid including line ending
This commit is contained in:
Ilya Kreymer 2015-08-09 09:25:02 -07:00
parent 341b210f91
commit 3ef5d98bc6
4 changed files with 13 additions and 5 deletions

View File

@ -1,4 +1,4 @@
PyWb 0.10.6
PyWb 0.10.7
===========
.. image:: https://travis-ci.org/ikreymer/pywb.svg?branch=master

View File

@ -1,4 +1,4 @@
__version__ = '0.10.6'
__version__ = '0.10.7-dev'
DEFAULT_CONFIG = 'pywb/default_config.yaml'

View File

@ -194,7 +194,9 @@ def test_local_unclosed_script():
assert '<head><script src="/static/__pywb/wombat.js"> </script>' in buff, buff
# JS location and JS link rewritten
assert 'window.WB_wombat_location = "/pywb/20131226101010/http:\/\/example.com/dynamic_page.html";\n}\n</script>' in buff, buff
assert 'window.WB_wombat_location = "/pywb/20131226101010/http:\/\/example.com/dynamic_page.html";' in buff, buff
assert '</script>' in buff, buff
def test_example_1():

View File

@ -1683,6 +1683,12 @@ var wombat_internal = function($wbwindow) {
var orig_get_cookie = get_orig_getter($wbwindow.document, "cookie");
var orig_set_cookie = get_orig_setter($wbwindow.document, "cookie");
if (!orig_get_cookie) {
orig_get_cookie = get_orig_getter($wbwindow.Document.prototype, "cookie");
}
if (!orig_set_cookie) {
orig_set_cookie = get_orig_setter($wbwindow.Document.prototype, "cookie");
}
function rewrite_cookie(cookie) {
var matched = cookie.match(cookie_path_regex);
@ -1839,8 +1845,8 @@ var wombat_internal = function($wbwindow) {
var orig_referrer = extract_orig($wbwindow.document.referrer);
def_prop($wbwindow.document, "domain", undefined, function() { return wbinfo.wombat_host });
// changing domain disallowed, but set as no-op to avoid errors
def_prop($wbwindow.document, "domain", function() {}, function() { return wbinfo.wombat_host });
def_prop($wbwindow.document, "referrer", undefined, function() { return orig_referrer; });