Skip to content

Commit 0c9e658

Browse files
authored
Record unbound Range requests only, don't convert bounded range requests to unbounded (#845)
* record fix: don't convert 0-N range requests to unbounded for recording, only record 0- (unbounded range requests) * tests: attempt to fix tests, disable youtube-dl related tests * bump to 2.7.4
1 parent 4a3e7dd commit 0c9e658

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212

1313
steps:
1414
- name: checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
1616

1717
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v1
18+
uses: actions/setup-python@v4
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121

@@ -28,5 +28,5 @@ jobs:
2828
run: tox
2929

3030
- name: Upload coverage to Codecov
31-
uses: codecov/codecov-action@v1
31+
uses: codecov/codecov-action@v3
3232

pywb/apps/rewriterapp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ def _check_range(self, inputreq, wb_url):
248248
range_start = start
249249
range_end = end
250250

251-
# if start with 0, load from upstream, but add range after
252-
if start == 0:
251+
# if start with 0 and no end, load from upstream
252+
if start == 0 and not end:
253253
del inputreq.env['HTTP_RANGE']
254254
else:
255255
skip_record = True

pywb/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '2.7.3'
1+
__version__ = '2.7.4'
22

33
if __name__ == '__main__':
44
print(__version__)

pywb/warcserver/test/test_handlers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,8 @@ def test_url_agnost(self):
385385
assert resp.headers['Warcserver-Source-Coll'] == 'url-agnost'
386386
assert resp.headers['Memento-Datetime'] == 'Mon, 29 Jul 2013 19:51:51 GMT'
387387

388-
@pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI')
388+
#@pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI')
389+
@pytest.mark.skip("youtube-dl update needed")
389390
def test_live_video_loader(self):
390391
pytest.importorskip('youtube_dl')
391392
params = {'url': 'http://www.youtube.com/v/BfBgWtAIbRc',
@@ -404,7 +405,8 @@ def test_live_video_loader(self):
404405
assert b'WARC-Type: metadata' in resp.body
405406
assert b'Content-Type: application/vnd.youtube-dl_formats+json' in resp.body
406407

407-
@pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI')
408+
#@pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI')
409+
@pytest.mark.skip("youtube-dl update needed")
408410
def test_live_video_loader_post(self):
409411
pytest.importorskip('youtube_dl')
410412
req_data = """\

tests/test_live_rewriter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ def test_live_invalid_2(self, fmod_sl):
169169
resp = resp.follow(status=400)
170170
assert resp.status_int == 400
171171

172-
@pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI')
172+
#@pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI')
173+
@pytest.mark.skip("youtube-dl update needed")
173174
def test_live_video_info(self):
174175
pytest.importorskip('youtube_dl')
175176
resp = self.testapp.get('/live/vi_/https://www.youtube.com/watch?v=DjFZyFWSt1M')

tests/test_range.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_replay_range_start_end(self, fmod):
2929
assert resp.headers['Content-Range'] == 'bytes 0-200/1270', resp.headers['Content-Range']
3030
assert resp.content_length == 201, resp.content_length
3131

32-
assert self.recorder_skip == None
32+
assert self.recorder_skip == '1'
3333

3434
assert 'wombat.js' not in resp.text
3535

0 commit comments

Comments
 (0)