Bug in ngx_http_slice_filter_module ngx_http_slice_parse_content_range function

Carey Gister careygister at outlook.com
Tue Jul 2 23:39:16 UTC 2019


Hi Maxim,

Thank you. By "production version" I meant the current release version, which if I recall correctly, is 1.17.1.

Ok. So then you recommend I copy the code that processes the If-Range header to determine if the If-Range is valid? I can then use those functions to determine the extent of the range, which is what I need to know.

Carey Gister
415-310-5304


________________________________
From: nginx-devel <nginx-devel-bounces at nginx.org> on behalf of Maxim Dounin <mdounin at mdounin.ru>
Sent: Tuesday, July 2, 2019 15:52
To: nginx-devel at nginx.org
Subject: Re: Bug in ngx_http_slice_filter_module ngx_http_slice_parse_content_range function

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/
_______________________________________________
nginx-devel mailing list
nginx-devel at nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20190702/33839ae5/attachment.html>


More information about the nginx-devel mailing list