]> git.kaiwu.me - njs.git/commitdiff
HTTP: setting default content type in sendHeader().
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 5 Feb 2019 16:27:24 +0000 (19:27 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 5 Feb 2019 16:27:24 +0000 (19:27 +0300)
nginx/ngx_http_js_module.c

index 8cb0173cf53fc2b1ddc5d80901f94aa5a2245bdb..a73c2d240d0c45a919db5ff625b7cf1daac6b7ed 100644 (file)
@@ -1035,6 +1035,10 @@ ngx_http_js_ext_send_header(njs_vm_t *vm, njs_value_t *args, nxt_uint_t nargs,
         return NJS_ERROR;
     }
 
+    if (ngx_http_set_content_type(r) != NGX_OK) {
+        return NJS_ERROR;
+    }
+
     if (ngx_http_send_header(r) == NGX_ERROR) {
         return NJS_ERROR;
     }