mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
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
This commit is contained in:
parent
4a3e7ddff7
commit
0c9e658c73
6
.github/workflows/ci.yaml
vendored
6
.github/workflows/ci.yaml
vendored
@ -12,10 +12,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
@ -28,5 +28,5 @@ jobs:
|
|||||||
run: tox
|
run: tox
|
||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v3
|
||||||
|
|
||||||
|
@ -248,8 +248,8 @@ class RewriterApp(object):
|
|||||||
range_start = start
|
range_start = start
|
||||||
range_end = end
|
range_end = end
|
||||||
|
|
||||||
# if start with 0, load from upstream, but add range after
|
# if start with 0 and no end, load from upstream
|
||||||
if start == 0:
|
if start == 0 and not end:
|
||||||
del inputreq.env['HTTP_RANGE']
|
del inputreq.env['HTTP_RANGE']
|
||||||
else:
|
else:
|
||||||
skip_record = True
|
skip_record = True
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
__version__ = '2.7.3'
|
__version__ = '2.7.4'
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print(__version__)
|
print(__version__)
|
||||||
|
@ -385,7 +385,8 @@ foo=bar&test=abc"""
|
|||||||
assert resp.headers['Warcserver-Source-Coll'] == 'url-agnost'
|
assert resp.headers['Warcserver-Source-Coll'] == 'url-agnost'
|
||||||
assert resp.headers['Memento-Datetime'] == 'Mon, 29 Jul 2013 19:51:51 GMT'
|
assert resp.headers['Memento-Datetime'] == 'Mon, 29 Jul 2013 19:51:51 GMT'
|
||||||
|
|
||||||
@pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI')
|
#@pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI')
|
||||||
|
@pytest.mark.skip("youtube-dl update needed")
|
||||||
def test_live_video_loader(self):
|
def test_live_video_loader(self):
|
||||||
pytest.importorskip('youtube_dl')
|
pytest.importorskip('youtube_dl')
|
||||||
params = {'url': 'http://www.youtube.com/v/BfBgWtAIbRc',
|
params = {'url': 'http://www.youtube.com/v/BfBgWtAIbRc',
|
||||||
@ -404,7 +405,8 @@ foo=bar&test=abc"""
|
|||||||
assert b'WARC-Type: metadata' in resp.body
|
assert b'WARC-Type: metadata' in resp.body
|
||||||
assert b'Content-Type: application/vnd.youtube-dl_formats+json' in resp.body
|
assert b'Content-Type: application/vnd.youtube-dl_formats+json' in resp.body
|
||||||
|
|
||||||
@pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI')
|
#@pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI')
|
||||||
|
@pytest.mark.skip("youtube-dl update needed")
|
||||||
def test_live_video_loader_post(self):
|
def test_live_video_loader_post(self):
|
||||||
pytest.importorskip('youtube_dl')
|
pytest.importorskip('youtube_dl')
|
||||||
req_data = """\
|
req_data = """\
|
||||||
|
@ -169,7 +169,8 @@ class TestLiveRewriter(HttpBinLiveTests, BaseConfigTest):
|
|||||||
resp = resp.follow(status=400)
|
resp = resp.follow(status=400)
|
||||||
assert resp.status_int == 400
|
assert resp.status_int == 400
|
||||||
|
|
||||||
@pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI')
|
#@pytest.mark.skipif(os.environ.get('CI') is not None, reason='Skip Test on CI')
|
||||||
|
@pytest.mark.skip("youtube-dl update needed")
|
||||||
def test_live_video_info(self):
|
def test_live_video_info(self):
|
||||||
pytest.importorskip('youtube_dl')
|
pytest.importorskip('youtube_dl')
|
||||||
resp = self.testapp.get('/live/vi_/https://www.youtube.com/watch?v=DjFZyFWSt1M')
|
resp = self.testapp.get('/live/vi_/https://www.youtube.com/watch?v=DjFZyFWSt1M')
|
||||||
|
@ -29,7 +29,7 @@ class TestReplayRange(BaseConfigTest):
|
|||||||
assert resp.headers['Content-Range'] == 'bytes 0-200/1270', resp.headers['Content-Range']
|
assert resp.headers['Content-Range'] == 'bytes 0-200/1270', resp.headers['Content-Range']
|
||||||
assert resp.content_length == 201, resp.content_length
|
assert resp.content_length == 201, resp.content_length
|
||||||
|
|
||||||
assert self.recorder_skip == None
|
assert self.recorder_skip == '1'
|
||||||
|
|
||||||
assert 'wombat.js' not in resp.text
|
assert 'wombat.js' not in resp.text
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user