From 41d51a6427db7a10b1acb01ec6bbc431b251778a Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Thu, 27 Mar 2014 14:46:59 -0700 Subject: [PATCH] ensure 'cdx_' modifier is working --- pywb/core/query_handler.py | 2 +- tests/test_integration.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pywb/core/query_handler.py b/pywb/core/query_handler.py index f2685077..029b9eaa 100644 --- a/pywb/core/query_handler.py +++ b/pywb/core/query_handler.py @@ -71,7 +71,7 @@ class QueryHandler(object): cdx_iter = self.load_cdx(wbrequest, params) - if wb_url.is_replay(): + if output != 'text' and wb_url.is_replay(): return (cdx_iter, self.cdx_load_callback(wbrequest)) return self.make_cdx_response(wbrequest, params, cdx_iter) diff --git a/tests/test_integration.py b/tests/test_integration.py index c5a4f43a..017a0ca8 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -91,6 +91,15 @@ class TestWb: assert 'wb.js' in resp.body assert '/pywb/20130729195151/http://www.iana.org/domains/example"' in resp.body + def test_replay_cdx_mod(self): + resp = self.testapp.get('/pywb/20140127171239cdx_/http://www.iana.org/_css/2013.1/print.css') + self._assert_basic_text(resp) + + lines = resp.body.rstrip().split('\n') + assert len(lines) == 17 + assert lines[0].startswith('org,iana)/_css/2013.1/print.css 20140127171239') + + def test_replay_identity_1(self): resp = self.testapp.get('/pywb/20140127171251id_/http://example.com')