[svn r140] Fixed wsgi.py to capitalize headers, fixed printing of ConnectionError exceptions when raised by FileScheme, cleaned up merge messup in coros.
This commit is contained in:
@@ -257,10 +257,14 @@ class ConnectionError(Exception):
|
|||||||
return time.time() > expires
|
return time.time() > expires
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
try:
|
||||||
response = self.params.response
|
response = self.params.response
|
||||||
return "%s(url=%r, method=%r, status=%r, reason=%r, body=%r)" % (
|
return "%s(url=%r, method=%r, status=%r, reason=%r, body=%r)" % (
|
||||||
self.__class__.__name__, self.params.url, self.params.method,
|
self.__class__.__name__, self.params.url, self.params.method,
|
||||||
response.status, response.reason, self.params.body)
|
response.status, response.reason, self.params.body)
|
||||||
|
except AttributeError:
|
||||||
|
return "%s(url=%r, method=%r)" % (
|
||||||
|
self.__class__.__name__, self.params.url, self.params.method)
|
||||||
|
|
||||||
__str__ = __repr__
|
__str__ = __repr__
|
||||||
|
|
||||||
|
@@ -190,7 +190,10 @@ class HttpProtocol(BaseHTTPServer.BaseHTTPRequestHandler):
|
|||||||
# Avoid dangling circular ref
|
# Avoid dangling circular ref
|
||||||
exc_info = None
|
exc_info = None
|
||||||
|
|
||||||
headers_set[:] = [status, response_headers]
|
capitalized_headers = [('-'.join([x.capitalize() for x in key.split('-')]), value)
|
||||||
|
for key, value in response_headers]
|
||||||
|
|
||||||
|
headers_set[:] = [status, capitalized_headers]
|
||||||
return write
|
return write
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user