From 0c7b9f1be2e4864b4a5e5e954cbebbb3dca59f3a Mon Sep 17 00:00:00 2001 From: l-n-s Date: Sun, 23 Jul 2017 16:38:59 -0400 Subject: [PATCH] Send content-length header --- pyseeder/server.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyseeder/server.py b/pyseeder/server.py index 4b575c9..5a2fff5 100644 --- a/pyseeder/server.py +++ b/pyseeder/server.py @@ -1,6 +1,7 @@ import http.server import urllib.parse import ssl +import os class ReseedHandler(http.server.SimpleHTTPRequestHandler): """Handles reseeding requests""" @@ -13,6 +14,8 @@ class ReseedHandler(http.server.SimpleHTTPRequestHandler): if path == "/i2pseeds.su3": self.send_response(200) self.send_header("Content-Type", "application/octet-stream") + self.send_header("Content-Length", + os.path.getsize(self.i2pseeds_file)) self.end_headers() with open(self.i2pseeds_file, 'rb') as f: self.wfile.write(f.read())