From 1f897ae67933e9819753ee03dc113ff25fadc429 Mon Sep 17 00:00:00 2001 From: dano Date: Mon, 19 May 2014 11:38:23 -0400 Subject: [PATCH] Fixes based on code review. Don't fall through if regex doesn't match. Use 'X-HTTP-Reason' instead of 'Reason'. --- tornado/curl_httpclient.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) -- 2.47.2