From: Per Kraulis Date: Thu, 10 Jul 2014 13:47:28 +0000 (+0200) Subject: Fixes bug disallowing custom-made reason phrase X-Git-Tag: v4.1.0b1~141^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=590ce3f3b810c2ea651e5c08be007bb4f1e8eb2e;p=thirdparty%2Ftornado.git Fixes bug disallowing custom-made reason phrase The send_error method is, I believe, supposed to allow sending an HTTP reason phrase that is not one of the standard ones. This change corrects an apparent bug which made this impossible. With the correction, specifying an 'error' keyword argument to send_error actually sends the specified reason phrase to the client. --- diff --git a/tornado/web.py b/tornado/web.py index 25ac56ebe..28477c269 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -919,7 +919,7 @@ class RequestHandler(object): return self.clear() - reason = None + reason = kwargs.get('reason') if 'exc_info' in kwargs: exception = kwargs['exc_info'][1] if isinstance(exception, HTTPError) and exception.reason: