[njs] HTTP: setting default content type in sendHeader().

Dmitry Volyntsev xeioex at nginx.com
Tue Feb 5 16:41:21 UTC 2019


details:   https://hg.nginx.org/njs/rev/3b8ea515add6
branches:  
changeset: 762:3b8ea515add6
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Feb 05 19:27:24 2019 +0300
description:
HTTP: setting default content type in sendHeader().

diffstat:

 nginx/ngx_http_js_module.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r 4dfc639287f0 -r 3b8ea515add6 nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c	Tue Feb 05 01:07:45 2019 +0800
+++ b/nginx/ngx_http_js_module.c	Tue Feb 05 19:27:24 2019 +0300
@@ -1035,6 +1035,10 @@ ngx_http_js_ext_send_header(njs_vm_t *vm
         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;
     }


More information about the nginx-devel mailing list