[njs] Fixed http status and contentType getter.

Dmitry Volyntsev xeioex at nginx.com
Wed Sep 19 16:45:38 UTC 2018


details:   http://hg.nginx.org/njs/rev/68a3580688ab
branches:  
changeset: 612:68a3580688ab
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Sep 19 19:36:00 2018 +0300
description:
Fixed http status and contentType getter.

Getter are expected to set resulting value to provied
argument, not to vm->retval.

diffstat:

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

diffs (21 lines):

diff -r 731e29c2b41e -r 68a3580688ab nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c	Wed Sep 19 19:24:07 2018 +0300
+++ b/nginx/ngx_http_js_module.c	Wed Sep 19 19:36:00 2018 +0300
@@ -1190,7 +1190,7 @@ ngx_http_js_ext_get_status(njs_vm_t *vm,
 
     r = (ngx_http_request_t *) obj;
 
-    njs_value_number_set(njs_vm_retval(vm), r->headers_out.status);
+    njs_value_number_set(value, r->headers_out.status);
 
     return NJS_OK;
 }
@@ -1224,7 +1224,7 @@ ngx_http_js_ext_get_content_length(njs_v
 
     r = (ngx_http_request_t *) obj;
 
-    njs_value_number_set(njs_vm_retval(vm), r->headers_out.content_length_n);
+    njs_value_number_set(value, r->headers_out.content_length_n);
 
     return NJS_OK;
 }


More information about the nginx-devel mailing list