diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-07-23 20:30:42 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-07-23 20:30:42 +0400 |
commit | 6df67879a0a020262e514dace0c0349742800cd1 (patch) | |
tree | c76694b72e31bc5b87827c1bf60cf0bb7da3e5e7 /src | |
parent | c6742cff8e8b41f987c0fd8341913d93fd31ea42 (diff) |
fix ranges without Content-Type
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_range_filter_module.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/http/modules/ngx_http_range_filter_module.c b/src/http/modules/ngx_http_range_filter_module.c index 8f5ff7976..e8134d164 100644 --- a/src/http/modules/ngx_http_range_filter_module.c +++ b/src/http/modules/ngx_http_range_filter_module.c @@ -393,8 +393,6 @@ ngx_http_range_multipart_header(ngx_http_request_t *r, ngx_http_range_t *range; ngx_atomic_uint_t boundary; - /* TODO: what if no content_type ?? */ - len = sizeof(CRLF "--") - 1 + NGX_ATOMIC_T_LEN + sizeof(CRLF "Content-Type: ") - 1 + r->headers_out.content_type.len @@ -431,7 +429,7 @@ ngx_http_range_multipart_header(ngx_http_request_t *r, r->headers_out.charset.len = 0; - } else { + } else if (r->headers_out.content_type.len) { ctx->boundary_header.len = ngx_sprintf(ctx->boundary_header.data, CRLF "--%0muA" CRLF "Content-Type: %V" CRLF @@ -439,6 +437,13 @@ ngx_http_range_multipart_header(ngx_http_request_t *r, boundary, &r->headers_out.content_type) - ctx->boundary_header.data; + + } else { + ctx->boundary_header.len = ngx_sprintf(ctx->boundary_header.data, + CRLF "--%0muA" CRLF + "Content-Range: bytes ", + boundary) + - ctx->boundary_header.data; } r->headers_out.content_type.data = |