~bzr-pqm/bzr/bzr.dev

Viewing all changes in revision 2004.1.16.

  • Committer: v.ladeuil+lp at free
  • Date: 2006-10-04 14:42:05 UTC
  • mto: (2145.1.1 keepalive)
  • mto: This revision was merged to the branch mainline in revision 2146.
  • Revision ID: v.ladeuil+lp@free.fr-20061004144205-6a7496410b893ab1
Add tests against erroneous http status lines.

* bzrlib/transport/http/_urllib2_wrappers.py:
(Response.begin): In some subtle cases we MUST not try to read the
response body.
(AbstractHTTPConnection.strict): Do not try to support HTTP/0.9 or we
may fail to detect bad status lines.
(AbstractHTTPHandler.do_open): Translate BasStatusLine into
InvalidHttpResponse and don't retry in that case.

* bzrlib/transport/http/_pycurl.py:
(PyCurlTransport.has): 

* bzrlib/transport/http/__init__.py:
(BadStatusRequestHandler, InvalidStatusRequestHandler): New classes.

* bzrlib/tests/test_http.py:
(TestBadStatusServer.create_transport_server,
TestBadStatusServer_urllib, TestBadStatusServer_pycurl,
TestInvalidStatusServer, TestInvalidStatusServer_urllib,
TestInvalidStatusServer_pycurl): New classes.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: