diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2021-02-25 21:42:59 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2021-03-02 10:14:25 -0500 |
commit | cc35c03c3cf8791d00d526eebc2fa5d5f748aec1 (patch) | |
tree | 8d46f2fc2dcdf9844e324d1e2e6f8bf2413e48c6 /src/response.c | |
parent | d68e639b7112004cbca381692385a16a1897b224 (diff) | |
download | lighttpd-git-cc35c03c3cf8791d00d526eebc2fa5d5f748aec1.tar.gz |
[core] RFC 7233 Range handling for non-streaming
RFC 7233 Range handling for all non-streaming responses,
including (non-streaming) dynamic responses
(previously Range responses handled only for static files)
Diffstat (limited to 'src/response.c')
-rw-r--r-- | src/response.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/response.c b/src/response.c index d243915d..7da19b11 100644 --- a/src/response.c +++ b/src/response.c @@ -11,6 +11,7 @@ #include "chunk.h" #include "http_chunk.h" #include "http_date.h" +#include "http_range.h" #include "plugin.h" @@ -868,6 +869,10 @@ http_response_write_prepare(request_st * const r) } if (r->resp_body_finished) { + /* check for Range request (current impl requires resp_body_finished) */ + if (r->conf.range_requests && http_range_rfc7233(r) >= 400) + http_response_static_errdoc(r); /* 416 Range Not Satisfiable */ + /* set content-length if length is known and not already set */ if (!(r->resp_htags & (light_bshift(HTTP_HEADER_CONTENT_LENGTH) |