From 0dbc80342250eb75437f453ab4a8140c4ad630af Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Sun, 26 Feb 2017 12:18:31 -0800 Subject: [PATCH] webagg: default 'memento+' config to /timemap/link/ instead of /timemap/*/ for greater compatibility --- pywb/webagg/indexsource.py | 4 ++-- pywb/webagg/test/test_autoapp.py | 2 +- pywb/webagg/test/test_autoapp.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pywb/webagg/indexsource.py b/pywb/webagg/indexsource.py index c1cfc457..d6564364 100644 --- a/pywb/webagg/indexsource.py +++ b/pywb/webagg/indexsource.py @@ -386,11 +386,11 @@ class MementoIndexSource(BaseIndexSource): @classmethod def init_from_string(cls, value): if value.startswith('memento+'): - return cls.from_timegate_url(value[8:], '*') + return cls.from_timegate_url(value[8:], 'link') # default to memento for any http url if value.startswith(('http://', 'https://')): - return cls.from_timegate_url(value, '*') + return cls.from_timegate_url(value, 'link') @classmethod diff --git a/pywb/webagg/test/test_autoapp.py b/pywb/webagg/test/test_autoapp.py index 73ec50af..7fa3eb83 100644 --- a/pywb/webagg/test/test_autoapp.py +++ b/pywb/webagg/test/test_autoapp.py @@ -67,7 +67,7 @@ class TestAutoConfigApp(TempDirTests, BaseTestClass): sources = self._get_sources('rhiz') assert isinstance(sources['rhiz'], MementoIndexSource) assert sources['rhiz'].timegate_url == 'http://webenact.rhizome.org/all/{url}' - assert sources['rhiz'].timemap_url == 'http://webenact.rhizome.org/all/timemap/*/{url}' + assert sources['rhiz'].timemap_url == 'http://webenact.rhizome.org/all/timemap/link/{url}' assert sources['rhiz'].replay_url == 'http://webenact.rhizome.org/all/{timestamp}id_/{url}' long_form_sources = self._get_sources('rhiz_long') diff --git a/pywb/webagg/test/test_autoapp.yaml b/pywb/webagg/test/test_autoapp.yaml index 2096bd4b..7ab962c2 100644 --- a/pywb/webagg/test/test_autoapp.yaml +++ b/pywb/webagg/test/test_autoapp.yaml @@ -29,7 +29,7 @@ collections: index: type: memento timegate_url: http://webenact.rhizome.org/all/{url} - timemap_url: http://webenact.rhizome.org/all/timemap/*/{url} + timemap_url: http://webenact.rhizome.org/all/timemap/link/{url} replay_url: http://webenact.rhizome.org/all/{timestamp}id_/{url} # many archives