Welcome! Log In Create A New Profile

Advanced

[nginx] Slice filter: clear original Accept-Ranges.

Roman Arutyunyan
July 09, 2020 10:44AM
details: https://hg.nginx.org/nginx/rev/32a343635b50
branches:
changeset: 7684:32a343635b50
user: Roman Arutyunyan <arut@nginx.com>
date: Thu Jul 09 16:21:37 2020 +0300
description:
Slice filter: clear original Accept-Ranges.

The slice filter allows ranges for the response by setting the r->allow_ranges
flag, which enables the range filter. If the range was not requested, the
range filter adds an Accept-Ranges header to the response to signal the
support for ranges.

Previously, if an Accept-Ranges header was already present in the first slice
response, client received two copies of this header. Now, the slice filter
removes the Accept-Ranges header from the response prior to setting the
r->allow_ranges flag.

diffstat:

src/http/modules/ngx_http_slice_filter_module.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r fac6e1a46206 -r 32a343635b50 src/http/modules/ngx_http_slice_filter_module.c
--- a/src/http/modules/ngx_http_slice_filter_module.c Thu Jul 09 17:33:22 2020 +0300
+++ b/src/http/modules/ngx_http_slice_filter_module.c Thu Jul 09 16:21:37 2020 +0300
@@ -180,6 +180,11 @@ ngx_http_slice_header_filter(ngx_http_re
r->headers_out.content_range->hash = 0;
r->headers_out.content_range = NULL;

+ if (r->headers_out.accept_ranges) {
+ r->headers_out.accept_ranges->hash = 0;
+ r->headers_out.accept_ranges = NULL;
+ }
+
r->allow_ranges = 1;
r->subrequest_ranges = 1;
r->single_range = 1;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Slice filter: clear original Accept-Ranges.

Roman Arutyunyan 114 July 09, 2020 10:44AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 104
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready