diff options
author | Joe Gregorio <jcgregorio@google.com> | 2012-07-23 12:18:53 -0400 |
---|---|---|
committer | Joe Gregorio <jcgregorio@google.com> | 2012-07-23 12:18:53 -0400 |
commit | 9f1f9ede0faf3f36b8f463f781b9860d8c56009a (patch) | |
tree | 37d52417530853fd0f489eb6f8816c5dc7847f1d | |
parent | f1a27dab071a4140ba9a853b7298a84443cfc8a3 (diff) | |
download | httplib2-9f1f9ede0faf3f36b8f463f781b9860d8c56009a.tar.gz |
Set the reason correctly when running on App Engine.
Patch from Alain Vongsouvanh.
Reviewed in http://codereview.appspot.com/6422051/
-rw-r--r-- | python2/httplib2/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/python2/httplib2/__init__.py b/python2/httplib2/__init__.py index 6d4d8bd..6737da0 100644 --- a/python2/httplib2/__init__.py +++ b/python2/httplib2/__init__.py @@ -994,13 +994,13 @@ class HTTPSConnectionWithTimeout(httplib.HTTPSConnection): else: host = self.host port = self.port - + for family, socktype, proto, canonname, sockaddr in socket.getaddrinfo( host, port, 0, socket.SOCK_STREAM): try: if use_proxy: sock = socks.socksocket(family, socktype, proto) - + sock.setproxy(proxy_type, proxy_host, proxy_port, proxy_rdns, proxy_user, proxy_pass) else: sock = socket.socket(family, socktype, proto) @@ -1108,6 +1108,7 @@ try: validate_certificate=self.validate_certificate) self.response = ResponseDict(response.headers) self.response['status'] = str(response.status_code) + self.response['reason'] = httplib.responses.get(response.status_code, 'Ok') self.response.status = response.status_code setattr(self.response, 'read', lambda : response.content) @@ -1654,6 +1655,7 @@ class Response(dict): for key, value in info.iteritems(): self[key] = value self.status = int(self.get('status', self.status)) + self.reason = self.get('reason', self.reason) def __getattr__(self, name): |