From e8be732de6d12a2be42c7de3338e597842afc1cb Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sat, 21 Jul 2018 00:39:05 +0200 Subject: [PATCH] Add Content-Length header field Clients might expect a Content-Length header field for HEAD responses. Including this header field also allows the use of byte ranges (and disables the use of chunked transfer encoding for the GET response). --- upload.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/upload.pm b/upload.pm index 54f286b..7da5ebf 100644 --- a/upload.pm +++ b/upload.pm @@ -64,6 +64,7 @@ sub handle_get_or_head { my $file_path = safe_filename($r); if (-r $file_path and -f _) { + $r->header_out('Content-Length', -s _); $r->allow_ranges; $r->send_http_header; $r->sendfile($file_path) unless $r->header_only;