Bug in ngx_http_slice_filter_module ngx_http_slice_parse_content_range function
Maxim Dounin
mdounin at mdounin.ru
Tue Jul 2 22:52:00 UTC 2019
Hello!
On Mon, Jul 01, 2019 at 10:07:41PM +0000, Carey Gister wrote:
> Thank you for your reply. My use case is as follows:
>
> After the slice header filter calls ngx_http_next_header_filter
> the contents of the request headers_out fields will be modified
> if an If-Range header is valid. The production version of the
> slice header filter already relies on the modified headers_out
> fields set by the range filter.
It is not clear what do you mean by "the production version", but
the slice header filter as available in nginx calls next filter
only after parsing r->header_out.content_range header. That is,
it uses Content-Range header from a backend response, not the one
set by the range header filter.
> My extension needs to know the bounds of the new range IF the
> If-Range header is valid. So I parse the new content_range value
> using the ngx_http_slice_parse_content_range function to return
> the stored values.
So, you are misusing the ngx_http_slice_parse_content_range()
function for something it's not intended for.
> If this is incorrect, then please tell me how I can know if the
> If-Range header is valid, preferably without duplicating the
> code in the range filter, and if it is valid, what the correct
> range values will be.
I don't think there is a good way.
--
Maxim Dounin
http://mdounin.ru/
More information about the nginx-devel
mailing list