bpo-33663: Convert content length to string before putting to header (GH-7754)

This commit is contained in:
ValeriyaSinevich 2018-06-18 14:17:53 -07:00 committed by Steve Dower
parent e57f91a0f0
commit b36b0a3765
2 changed files with 2 additions and 1 deletions

View 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:

View File

@ -0,0 +1 @@
Convert content length to string before putting to header.