]> granicus.if.org Git - python/commitdiff
bpo-33663: Convert content length to string before putting to header (GH-7754)
authorValeriyaSinevich <valeriya.sinevich@phystech.edu>
Mon, 18 Jun 2018 21:17:53 +0000 (14:17 -0700)
committerSteve Dower <steve.dower@microsoft.com>
Mon, 18 Jun 2018 21:17:53 +0000 (14:17 -0700)
Lib/http/server.py
Misc/NEWS.d/next/Library/2018-06-17-10-48-03.bpo-33663.sUuGmq.rst [new file with mode: 0644]

index ea0e295d283442e058b3906292a5d9176c26834a..ca2dd507392c8ec8de7eb94ede1efbe7f20cb02b 100644 (file)
@@ -474,7 +474,7 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
             })
             body = content.encode('UTF-8', 'replace')
             self.send_header("Content-Type", self.error_content_type)
-            self.send_header('Content-Length', int(len(body)))
+            self.send_header('Content-Length', str(len(body)))
         self.end_headers()
 
         if self.command != 'HEAD' and body:
diff --git a/Misc/NEWS.d/next/Library/2018-06-17-10-48-03.bpo-33663.sUuGmq.rst b/Misc/NEWS.d/next/Library/2018-06-17-10-48-03.bpo-33663.sUuGmq.rst
new file mode 100644 (file)
index 0000000..b2a8e3c
--- /dev/null
@@ -0,0 +1 @@
+Convert content length to string before putting to header.