Skip to content

Commit 8c19a44

Browse files
bpo-33663: Convert content length to string before putting to header (GH-7754)
(cherry picked from commit b36b0a3) Co-authored-by: ValeriyaSinevich <valeriya.sinevich@phystech.edu>
1 parent d9a8c82 commit 8c19a44

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/http/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ def send_error(self, code, message=None, explain=None):
466466
})
467467
body = content.encode('UTF-8', 'replace')
468468
self.send_header("Content-Type", self.error_content_type)
469-
self.send_header('Content-Length', int(len(body)))
469+
self.send_header('Content-Length', str(len(body)))
470470
self.end_headers()
471471

472472
if self.command != 'HEAD' and body:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Convert content length to string before putting to header.

0 commit comments

Comments
 (0)