Rev 2938: Don't pretend we support HTTP/0.9 since we don't and do that correctly. in file:///v/home/vila/src/bzr/experimental/https/

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Nov 22 10:21:45 GMT 2007


At file:///v/home/vila/src/bzr/experimental/https/

------------------------------------------------------------
revno: 2938
revision-id:v.ladeuil+lp at free.fr-20071122102144-adjrfkg2q7edfu43
parent: v.ladeuil+lp at free.fr-20071120180202-em1ya597eoza05l6
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: https
timestamp: Thu 2007-11-22 11:21:44 +0100
message:
  Don't pretend we support HTTP/0.9 since we don't and do that correctly.
  
  * bzrlib/transport/http/_urllib2_wrappers.py:
  (AbstractHTTPConnection): Specifying strict here is useless.
  (HTTPConnection, HTTPSConnection): We don't support HTTP/0.9 in
  other parts of the stack, be explicit *correctly*.
modified:
  bzrlib/transport/http/_urllib2_wrappers.py _urllib2_wrappers.py-20060913231729-ha9ugi48ktx481ao-1
-------------- next part --------------
=== modified file 'bzrlib/transport/http/_urllib2_wrappers.py'
--- a/bzrlib/transport/http/_urllib2_wrappers.py	2007-11-20 10:59:42 +0000
+++ b/bzrlib/transport/http/_urllib2_wrappers.py	2007-11-22 10:21:44 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2006 Canonical Ltd
+# Copyright (C) 2006, 2007 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -122,7 +122,6 @@
     """A custom HTTP(S) Connection, which can reset itself on a bad response"""
 
     response_class = Response
-    strict = 1 # We don't support HTTP/0.9
 
     def fake_close(self):
         """Make the connection believes the response have been fully handled.
@@ -141,17 +140,20 @@
 class HTTPConnection(AbstractHTTPConnection, httplib.HTTPConnection):
 
     # XXX: Needs refactoring at the caller level.
-    def __init__(self, host, port=None, strict=None, proxied_host=None):
-        httplib.HTTPConnection.__init__(self, host, port, strict)
+    def __init__(self, host, port=None, proxied_host=None):
+        # Use strict=True since we don't support HTTP/0.9
+        httplib.HTTPConnection.__init__(self, host, port, strict=True)
         self.proxied_host = proxied_host
 
 
+# FIXME: Should test for ssl availability
 class HTTPSConnection(AbstractHTTPConnection, httplib.HTTPSConnection):
 
     def __init__(self, host, port=None, key_file=None, cert_file=None,
-                 strict=None, proxied_host=None):
+                 proxied_host=None):
+        # Use strict=True since we don't support HTTP/0.9
         httplib.HTTPSConnection.__init__(self, host, port,
-                                         key_file, cert_file, strict)
+                                         key_file, cert_file, strict=True)
         self.proxied_host = proxied_host
 
     def connect(self):
@@ -522,7 +524,7 @@
             # - with and without certificate
             # - with self-signed certificate
             # - with and without authentication
-            # - with good and bad credentials (especially the proxy auth aound
+            # - with good and bad credentials (especially the proxy auth around
             #   CONNECT)
             # - with basic and digest schemes
             # - reconnection on errors



More information about the bazaar-commits mailing list