fix(cli/fetch): set null body for null-body status (#5980)

This commit is contained in:
Marcos Casagrande 2020-06-01 01:21:14 +02:00 committed by GitHub
parent 08552fc6b9
commit edeeedf401
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 76 additions and 26 deletions

View file

@ -194,8 +194,9 @@ class ContentTypeHandler(QuietSimpleHTTPRequestHandler):
def do_POST(self):
# Simple echo server for request reflection
if "echo_server" in self.path:
status = int(self.headers.getheader('x-status', "200"))
self.protocol_version = 'HTTP/1.1'
self.send_response(200, 'OK')
self.send_response(status, 'OK')
if self.headers.has_key('content-type'):
self.send_header('content-type',
self.headers.getheader('content-type'))