Welcome! Log In Create A New Profile

Advanced

[njs] HTTP: fixed r.headersOut special getters when value is absent.

Dmitry Volyntsev
June 08, 2022 01:14PM
details: https://hg.nginx.org/njs/rev/6ef77c24c924
branches:
changeset: 1878:6ef77c24c924
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Mon Jun 06 23:27:11 2022 -0700
description:
HTTP: fixed r.headersOut special getters when value is absent.

Previously, when Content-Encoding or Content-Length header was absent,
an exception was thrown erroneously.

This closes #537 issue on Github.

diffstat:

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

diffs (39 lines):

diff -r 9c4858617097 -r 6ef77c24c924 nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c Fri Jun 03 23:24:12 2022 -0700
+++ b/nginx/ngx_http_js_module.c Mon Jun 06 23:27:11 2022 -0700
@@ -1900,7 +1900,7 @@ ngx_http_js_content_encoding(njs_vm_t *v
ngx_table_elt_t *h;

rc = ngx_http_js_header_out_special(vm, r, v, setval, retval, &h);
- if (rc != NJS_OK) {
+ if (rc == NJS_ERROR) {
return NJS_ERROR;
}

@@ -1940,7 +1940,7 @@ ngx_http_js_content_length(njs_vm_t *vm,
}

rc = ngx_http_js_header_out_special(vm, r, v, setval, retval, &h);
- if (rc != NJS_OK) {
+ if (rc == NJS_ERROR) {
return NJS_ERROR;
}

@@ -3686,7 +3686,7 @@ ngx_http_js_content_encoding(njs_vm_t *v
ngx_table_elt_t *h;

rc = ngx_http_js_header_out_special(vm, r, v, setval, retval, &h);
- if (rc != NJS_OK) {
+ if (rc == NJS_ERROR) {
return NJS_ERROR;
}

@@ -3726,7 +3726,7 @@ ngx_http_js_content_length(njs_vm_t *vm,
}

rc = ngx_http_js_header_out_special(vm, r, v, setval, retval, &h);
- if (rc != NJS_OK) {
+ if (rc == NJS_ERROR) {
return NJS_ERROR;
}

_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[njs] HTTP: fixed r.headersOut special getters when value is absent.

Dmitry Volyntsev 341 June 08, 2022 01:14PM



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

Online Users

Guests: 123
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready