Welcome! Log In Create A New Profile

Advanced

[njs] HTTP: returning undefined value when "responseBody" is unavailable.

Dmitry Volyntsev
March 20, 2020 10:58AM
details: https://hg.nginx.org/njs/rev/83c9c195a8e2
branches:
changeset: 1359:83c9c195a8e2
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Fri Mar 20 17:33:10 2020 +0300
description:
HTTP: returning undefined value when "responseBody" is unavailable.

Missed in b758915e2406.

diffstat:

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

diffs (17 lines):

diff -r 573d264cb7e7 -r 83c9c195a8e2 nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c Fri Mar 20 17:33:06 2020 +0300
+++ b/nginx/ngx_http_js_module.c Fri Mar 20 17:33:10 2020 +0300
@@ -2196,7 +2196,12 @@ ngx_http_js_ext_get_response_body(njs_vm

b = r->out ? r->out->buf : NULL;

- len = b ? b->last - b->pos : 0;
+ if (b == NULL) {
+ njs_value_undefined_set(retval);
+ return NJS_OK;
+ }
+
+ len = b->last - b->pos;

p = njs_vm_value_string_alloc(vm, retval, len);
if (p == NULL) {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] HTTP: returning undefined value when "responseBody" is unavailable.

Dmitry Volyntsev 55 March 20, 2020 10:58AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 77
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready