From ed48191676836e8a8cd5d3ebc60acfc24f506c09 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Tue, 5 Feb 2019 19:27:24 +0300 Subject: [PATCH] HTTP: setting default content type in sendHeader(). --- nginx/ngx_http_js_module.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index 8cb0173c..a73c2d24 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -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; } -- 2.47.3