From: dano Date: Mon, 19 May 2014 15:38:23 +0000 (-0400) Subject: Fixes based on code review. X-Git-Tag: v4.0.0b1~56^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f897ae67933e9819753ee03dc113ff25fadc429;p=thirdparty%2Ftornado.git Fixes based on code review. Don't fall through if regex doesn't match. Use 'X-HTTP-Reason' instead of 'Reason'. --- diff --git a/tornado/curl_httpclient.py b/tornado/curl_httpclient.py index c489f00fb..26401e3ec 100644 --- a/tornado/curl_httpclient.py +++ b/tornado/curl_httpclient.py @@ -268,7 +268,7 @@ class CurlAsyncHTTPClient(AsyncHTTPClient): info["callback"](HTTPResponse( request=info["request"], code=code, headers=info["headers"], buffer=buffer, effective_url=effective_url, error=error, - reason=info['headers'].get("reason", None), + reason=info['headers'].get("x-http-reason", None), request_time=time.time() - info["curl_start_time"], time_info=time_info)) except Exception: @@ -473,9 +473,9 @@ def _curl_header_callback(headers, header_line): headers.clear() try: (__, __, reason) = httputil.parse_response_start_line(header_line) - header_line = "Reason: %s" % reason + header_line = "X-HTTP-Reason: %s" % reason except AssertionError: - pass + return if not header_line: return headers.parse_line(header_line)