From 590ce3f3b810c2ea651e5c08be007bb4f1e8eb2e Mon Sep 17 00:00:00 2001 From: Per Kraulis Date: Thu, 10 Jul 2014 15:47:28 +0200 Subject: [PATCH] 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. --- tornado/web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- 2.47.2