Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(180)

Unified Diff: python2/httplib2/__init__.py

Issue 6422051: Infer HTTP reason from status code on GAE (issue #218).
Patch Set: Created 13 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: python2/httplib2/__init__.py
===================================================================
--- a/python2/httplib2/__init__.py
+++ b/python2/httplib2/__init__.py
@@ -994,13 +994,13 @@
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 @@
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 @@
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):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b