]> granicus.if.org Git - python/commitdiff
bpo-33663: Convert content length to string before putting to header (GH-7754)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 18 Jun 2018 21:41:08 +0000 (14:41 -0700)
committerGitHub <noreply@github.com>
Mon, 18 Jun 2018 21:41:08 +0000 (14:41 -0700)
(cherry picked from commit b36b0a3765bcacb4dcdbf12060e9e99711855da8)

Co-authored-by: ValeriyaSinevich <valeriya.sinevich@phystech.edu>
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 e12e45bfc3809577ec861d04e870c38cad320972..60a4dadf033600252f91c217b7a90aa49dea63a2 100644 (file)
@@ -466,7 +466,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.