Do not send a Connection: close header

This commit is contained in:
croneter 2021-10-18 09:41:38 +02:00
parent 492e235a53
commit c107eb2ed8

View file

@ -90,9 +90,9 @@ class MyHandler(BaseHTTPRequestHandler):
for key in headers: for key in headers:
self.send_header(key, headers[key]) self.send_header(key, headers[key])
self.send_header('Content-Length', len(body)) self.send_header('Content-Length', len(body))
self.send_header('Connection', "close")
self.end_headers() self.end_headers()
self.wfile.write(body.encode('utf-8')) if body:
self.wfile.write(body.encode('utf-8'))
except Exception as exc: except Exception as exc:
LOG.debug('Exception encountered while responding: %s', exc) LOG.debug('Exception encountered while responding: %s', exc)