diff --git a/pywb/warcserver/inputrequest.py b/pywb/warcserver/inputrequest.py index 6b888516..5e04a0ef 100644 --- a/pywb/warcserver/inputrequest.py +++ b/pywb/warcserver/inputrequest.py @@ -77,7 +77,7 @@ class DirectWSGIInputRequest(object): method = self.get_req_method() - if method not in ('OPTIONS', 'HEAD', 'POST'): + if method not in ('OPTIONS', 'POST'): return url mime = self._get_content_type() diff --git a/tests/test_integration.py b/tests/test_integration.py index aed47aba..46bf8b8f 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -81,6 +81,20 @@ class TestWbIntegration(BaseConfigTest): assert 'Content-Security-Policy' not in resp.headers + def test_replay_content_head(self, fmod): + resp = self.head('/pywb/20140127171238{0}/http://www.iana.org/', fmod, status=200) + assert not resp.headers.get('Content-Length') + + def test_replay_content_head_non_zero_content_length_match(self): + resp = self.testapp.get('/pywb/id_/http://www.iana.org/_js/2013.1/jquery.js', status=200) + length = resp.content_length + + # Content-Length included if non-zero + resp = self.testapp.head('/pywb/id_/http://www.iana.org/_js/2013.1/jquery.js', status=200) + + #assert resp.headers['Content-Length'] == length + assert resp.content_length == length + def test_replay_content(self, fmod): resp = self.get('/pywb/20140127171238{0}/http://www.iana.org/', fmod) self._assert_basic_html(resp)