Refs #25684 -- Removed double newline from request/response output of runserver.
Follow up to 0bc5cd6280
.
This commit is contained in:
parent
5d13cc540e
commit
cdd4ff67d2
|
@ -77,7 +77,7 @@ class WSGIServer(simple_server.WSGIServer):
|
||||||
|
|
||||||
def handle_error(self, request, client_address):
|
def handle_error(self, request, client_address):
|
||||||
if is_broken_pipe_error():
|
if is_broken_pipe_error():
|
||||||
logger.info("- Broken pipe from %s\n", client_address)
|
logger.info("- Broken pipe from %s", client_address)
|
||||||
else:
|
else:
|
||||||
super().handle_error(request, client_address)
|
super().handle_error(request, client_address)
|
||||||
|
|
||||||
|
@ -166,7 +166,7 @@ class WSGIRequestHandler(simple_server.WSGIRequestHandler):
|
||||||
extra["status_code"] = 500
|
extra["status_code"] = 500
|
||||||
logger.error(
|
logger.error(
|
||||||
"You're accessing the development server over HTTPS, but "
|
"You're accessing the development server over HTTPS, but "
|
||||||
"it only supports HTTP.\n",
|
"it only supports HTTP.",
|
||||||
extra=extra,
|
extra=extra,
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
|
@ -50,7 +50,7 @@ class WSGIRequestHandlerTestCase(SimpleTestCase):
|
||||||
|
|
||||||
with self.assertLogs("django.server", "ERROR") as cm:
|
with self.assertLogs("django.server", "ERROR") as cm:
|
||||||
handler.log_message("GET %s %s", "\x16\x03", "4")
|
handler.log_message("GET %s %s", "\x16\x03", "4")
|
||||||
self.assertIn(
|
self.assertEqual(
|
||||||
"You're accessing the development server over HTTPS, "
|
"You're accessing the development server over HTTPS, "
|
||||||
"but it only supports HTTP.",
|
"but it only supports HTTP.",
|
||||||
cm.records[0].getMessage(),
|
cm.records[0].getMessage(),
|
||||||
|
@ -114,7 +114,7 @@ class WSGIServerTestCase(SimpleTestCase):
|
||||||
"""WSGIServer handles broken pipe errors."""
|
"""WSGIServer handles broken pipe errors."""
|
||||||
request = WSGIRequest(self.request_factory.get("/").environ)
|
request = WSGIRequest(self.request_factory.get("/").environ)
|
||||||
client_address = ("192.168.2.0", 8080)
|
client_address = ("192.168.2.0", 8080)
|
||||||
msg = f"- Broken pipe from {client_address}\n"
|
msg = f"- Broken pipe from {client_address}"
|
||||||
tests = [
|
tests = [
|
||||||
BrokenPipeError,
|
BrokenPipeError,
|
||||||
ConnectionAbortedError,
|
ConnectionAbortedError,
|
||||||
|
|
Loading…
Reference in New Issue