Skip to content

Commit

Permalink
Bugfix: Resulted in duplicated Content-length in nginx1.6.0 because o…
Browse files Browse the repository at this point in the history
…f r->headers_out.content_length is NULL
  • Loading branch information
renyongquan committed Jul 17, 2014
1 parent f0c5a13 commit a45802e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ngx_http_subrange_module.c
Expand Up @@ -765,7 +765,7 @@ static ngx_int_t ngx_http_subrange_header_filter(ngx_http_request_t *r){
content_length.data = ngx_palloc(r->pool, NGX_SIZE_T_LEN);
content_length.len = ngx_sprintf(content_length.data, "%ui", ctx->content_range.total)
- content_length.data;
ngx_http_subrange_set_header(r, &r->headers_out.headers, content_length_key, content_length,NULL);
ngx_http_subrange_set_header(r, &r->headers_out.headers, content_length_key, content_length, &r->headers_out.content_length);

r->headers_out.status_line = ngx_http_status_lines[0];
r->headers_in.range = NULL; // clear the request range header to surpress ngx_http_range_filter_module
Expand All @@ -777,7 +777,7 @@ static ngx_int_t ngx_http_subrange_header_filter(ngx_http_request_t *r){
content_length.data = ngx_palloc(r->pool, NGX_SIZE_T_LEN);
content_length.len = ngx_sprintf(content_length.data, "%ui", r->headers_out.content_length_n)
- content_length.data;
ngx_http_subrange_set_header(r, &r->headers_out.headers, content_length_key, content_length, NULL);
ngx_http_subrange_set_header(r, &r->headers_out.headers, content_length_key, content_length, &r->headers_out.content_length);

size = 0;
size += sizeof("bytes -/") - 1 + 3 * NGX_SIZE_T_LEN;
Expand Down

0 comments on commit a45802e

Please sign in to comment.