mirror of
https://github.com/weiss/ngx_http_upload.git
synced 2025-07-01 18:29:39 +00:00
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).
This commit is contained in:
parent
2100ca5d66
commit
e8be732de6
@ -64,6 +64,7 @@ sub handle_get_or_head {
|
|||||||
my $file_path = safe_filename($r);
|
my $file_path = safe_filename($r);
|
||||||
|
|
||||||
if (-r $file_path and -f _) {
|
if (-r $file_path and -f _) {
|
||||||
|
$r->header_out('Content-Length', -s _);
|
||||||
$r->allow_ranges;
|
$r->allow_ranges;
|
||||||
$r->send_http_header;
|
$r->send_http_header;
|
||||||
$r->sendfile($file_path) unless $r->header_only;
|
$r->sendfile($file_path) unless $r->header_only;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user