diff --git a/ngx_http_fancyindex_module.c b/ngx_http_fancyindex_module.c index 5e9ef16..7c840a7 100644 --- a/ngx_http_fancyindex_module.c +++ b/ngx_http_fancyindex_module.c @@ -280,8 +280,7 @@ ngx_http_fancyindex_handler(ngx_http_request_t *r) } r->headers_out.status = NGX_HTTP_OK; - r->headers_out.content_type_len = sizeof("text/html") - 1; - r->headers_out.content_type.len = sizeof("text/html") - 1; + r->headers_out.content_type_len = nfi_sizeof_ssz("text/html"); r->headers_out.content_type.data = (u_char *) "text/html"; rc = ngx_http_send_header(r); @@ -394,16 +393,26 @@ ngx_http_fancyindex_handler(ngx_http_request_t *r) entry = entries.elts; for (i = 0; i < entries.nelts; i++) { - len += sizeof("") - 1 - + entry[i].name.len - entry[i].utf_len - + NGX_HTTP_FANCYINDEX_NAME_LEN + sizeof(">") - 2 - + sizeof("") - 1 - + sizeof(" 28-Sep-1970 12:00 ") - 1 - + 20 /* the file size */ - + 2; + /* + * Genearated table rows are as follows, unneeded whitespace + * is stripped out: + * + *