Skip to content

Commit b36b0a3

Browse files
ValeriyaSinevichzooba
authored andcommitted
bpo-33663: Convert content length to string before putting to header (GH-7754)
1 parent e57f91a commit b36b0a3

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
@@ -474,7 +474,7 @@ def send_error(self, code, message=None, explain=None):
474474
})
475475
body = content.encode('UTF-8', 'replace')
476476
self.send_header("Content-Type", self.error_content_type)
477-
self.send_header('Content-Length', int(len(body)))
477+
self.send_header('Content-Length', str(len(body)))
478478
self.end_headers()
479479

480480
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)