]> granicus.if.org Git - python/commitdiff
Fix Issue #12921: BaseHTTPServer's send_error should send the correct error
authorSenthil Kumaran <senthil@uthcode.com>
Tue, 5 Mar 2013 09:21:13 +0000 (01:21 -0800)
committerSenthil Kumaran <senthil@uthcode.com>
Tue, 5 Mar 2013 09:21:13 +0000 (01:21 -0800)
response message when  send_error includes a message in addition to error
status. Patch contributed by Karl.

Lib/BaseHTTPServer.py
Misc/NEWS

index deaf2f960b83c76b38b0c494db91202c70886833..ce9ade963e91023653c7aa054c5ce9daf2b41fd4 100644 (file)
@@ -365,7 +365,7 @@ class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
         # using _quote_html to prevent Cross Site Scripting attacks (see bug #1100201)
         content = (self.error_message_format %
                    {'code': code, 'message': _quote_html(message), 'explain': explain})
-        self.send_response(code, message)
+        self.send_response(code, short)
         self.send_header("Content-Type", self.error_content_type)
         self.send_header('Connection', 'close')
         self.end_headers()
index 588a5c640255074a2e002572c9c0e902986f5dee..8b90f7c841e4a1629cf7772450c5f6fc25a4dfe4 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -214,6 +214,10 @@ Core and Builtins
 Library
 -------
 
+- Issue #12921: BaseHTTPServer's send_error should send the correct error
+  response message when  send_error includes a message in addition to error
+  status. Patch submitted by Karl.
+
 - Issue #17278: Fix a crash in heapq.heappush() and heapq.heappop() when
   the list is being resized concurrently.