aboutsummaryrefslogtreecommitdiff
path: root/nginx/ngx_http_js_module.c
diff options
context:
space:
mode:
authorDmitry Volyntsev <xeioex@nginx.com>2019-02-05 19:27:24 +0300
committerDmitry Volyntsev <xeioex@nginx.com>2019-02-05 19:27:24 +0300
commited48191676836e8a8cd5d3ebc60acfc24f506c09 (patch)
tree3c6ba4ccc38e80d828d3659d3475198e991f8038 /nginx/ngx_http_js_module.c
parent75212789b4424de5cc6a56cacb47d783d85aa9c9 (diff)
downloadnjs-ed48191676836e8a8cd5d3ebc60acfc24f506c09.tar.gz
njs-ed48191676836e8a8cd5d3ebc60acfc24f506c09.zip
HTTP: setting default content type in sendHeader().
Diffstat (limited to 'nginx/ngx_http_js_module.c')
-rw-r--r--nginx/ngx_http_js_module.c4
1 files changed, 4 insertions, 0 deletions
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;
}