This fixes content type set in stub_status and autoindex responses
to be usable in content type checks made by filter modules, such
as charset and sub filters.
r->headers_out.status = NGX_HTTP_OK;
r->headers_out.content_type_len = sizeof("text/html") - 1;
ngx_str_set(&r->headers_out.content_type, "text/html");
+ r->headers_out.content_type_lowcase = NULL;
rc = ngx_http_send_header(r);
ngx_http_clean_header(r);
r->headers_out.status = NGX_HTTP_OK;
+ r->headers_out.content_type_len = sizeof("application/json") - 1;
ngx_str_set(&r->headers_out.content_type, "application/json");
r->headers_out.content_type_lowcase = NULL;
return rc;
}
+ r->headers_out.content_type_len = sizeof("text/plain") - 1;
ngx_str_set(&r->headers_out.content_type, "text/plain");
+ r->headers_out.content_type_lowcase = NULL;
if (r->method == NGX_HTTP_HEAD) {
r->headers_out.status = NGX_HTTP_OK;