semantics of ngx_http_test_content_type when the Content-Type contains a charset?

Brian Pane brianp at
Fri Feb 19 11:13:48 MSK 2010

On Fri, Feb 19, 2010 at 12:06 AM, Brian Pane <brianp at> wrote:
> If an HTTP response has a Content-Type with a charset, like this:
>  Content-Type: text/html; charset=utf-8
> the ngx_http_test_content_type function tries to match the entire
> header value, including the "charset=utf-8" part, against the supplied
> types hash.  If the hash contains just "text/html" the "text/html;
> charset=utf-8" won't match, and ngx_http_test_content_type will return
> null.

oops, this isn't actually a problem after all.  I misread the
"headers_out.content_type_len" as "headers_out.content_type.len"

So the response header with "Content-Type: text/html; charset=utf-8"
will indeed match against a hash containing "text/html"

Never mind.  :-)


More information about the nginx-devel mailing list