]> git.kaiwu.me - nginx.git/commitdiff
Image filter: use "application/json" MIME type for JSON output.
authorValentin Bartenev <vbart@nginx.com>
Mon, 5 Aug 2013 10:30:03 +0000 (14:30 +0400)
committerValentin Bartenev <vbart@nginx.com>
Mon, 5 Aug 2013 10:30:03 +0000 (14:30 +0400)
As it is defined by RFC 4627, and allows for various browser tools like
JSONView to display JSON well-formatted.

src/http/modules/ngx_http_image_filter_module.c

index c6c3b747a3204bff5cb92d64145395c9ff4fb0c4..6d3f47dcbf56c360496dfe73fdbb1db551221ff3 100644 (file)
@@ -567,7 +567,7 @@ ngx_http_image_json(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
     ngx_http_clean_header(r);
 
     r->headers_out.status = NGX_HTTP_OK;
-    ngx_str_set(&r->headers_out.content_type, "text/plain");
+    ngx_str_set(&r->headers_out.content_type, "application/json");
     r->headers_out.content_type_lowcase = NULL;
 
     if (ctx == NULL) {