diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-06-18 21:41:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-18 21:41:08 (GMT) |
commit | 8c19a44b63033e9c70e9b552476baecb6e3e9451 (patch) | |
tree | f2c949559c342a3042dce905c571b3f2d944928c | |
parent | d9a8c829563e2c938aa7de0ffb90c5baa2f05b2d (diff) | |
download | cpython-8c19a44b63033e9c70e9b552476baecb6e3e9451.zip cpython-8c19a44b63033e9c70e9b552476baecb6e3e9451.tar.gz cpython-8c19a44b63033e9c70e9b552476baecb6e3e9451.tar.bz2 |
bpo-33663: Convert content length to string before putting to header (GH-7754)
(cherry picked from commit b36b0a3765bcacb4dcdbf12060e9e99711855da8)
Co-authored-by: ValeriyaSinevich <valeriya.sinevich@phystech.edu>
-rw-r--r-- | Lib/http/server.py | 2 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Library/2018-06-17-10-48-03.bpo-33663.sUuGmq.rst | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/Lib/http/server.py b/Lib/http/server.py index e12e45b..60a4dad 100644 --- a/Lib/http/server.py +++ b/Lib/http/server.py @@ -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 index 0000000..b2a8e3c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-06-17-10-48-03.bpo-33663.sUuGmq.rst @@ -0,0 +1 @@ +Convert content length to string before putting to header. |