Welcome! Log In Create A New Profile

Advanced

[njs] HTTP: added support for delete operation in r.headersOut.

Dmitry Volyntsev
February 07, 2019 12:42PM
details: https://hg.nginx.org/njs/rev/0913527ad077
branches:
changeset: 767:0913527ad077
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Thu Feb 07 20:05:14 2019 +0300
description:
HTTP: added support for delete operation in r.headersOut.

This closes #64 issue on Github.

diffstat:

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

diffs (40 lines):

diff -r 016d5d9077ef -r 0913527ad077 nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c Wed Feb 06 19:52:54 2019 +0300
+++ b/nginx/ngx_http_js_module.c Thu Feb 07 20:05:14 2019 +0300
@@ -71,6 +71,8 @@ static njs_ret_t ngx_http_js_ext_get_hea
njs_value_t *value, void *obj, uintptr_t data);
static njs_ret_t ngx_http_js_ext_set_header_out(njs_vm_t *vm, void *obj,
uintptr_t data, nxt_str_t *value);
+static njs_ret_t ngx_http_js_ext_delete_header_out(njs_vm_t *vm, void *obj,
+ uintptr_t data, nxt_bool_t delete);
static njs_ret_t ngx_http_js_ext_foreach_header_out(njs_vm_t *vm, void *obj,
void *next); /*FIXME*/
static njs_ret_t ngx_http_js_ext_get_status(njs_vm_t *vm, njs_value_t *value,
@@ -344,7 +346,7 @@ static njs_external_t ngx_http_js_ext_r
0,
ngx_http_js_ext_get_header_out,
ngx_http_js_ext_set_header_out,
- NULL,
+ ngx_http_js_ext_delete_header_out,
ngx_http_js_ext_foreach_header_out,
ngx_http_js_ext_next_header,
NULL,
@@ -1016,6 +1018,18 @@ ngx_http_js_ext_set_header_out(njs_vm_t


static njs_ret_t
+ngx_http_js_ext_delete_header_out(njs_vm_t *vm, void *obj, uintptr_t data,
+ nxt_bool_t unused)
+{
+ nxt_str_t value;
+
+ value = nxt_string_value("");
+
+ return ngx_http_js_ext_set_header_out(vm, obj, data, &value);
+}
+
+
+static njs_ret_t
ngx_http_js_ext_foreach_header_out(njs_vm_t *vm, void *obj, void *next)
{
return ngx_http_js_ext_foreach_header(vm, obj, next,
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] HTTP: added support for delete operation in r.headersOut.

Dmitry Volyntsev 108 February 07, 2019 12:42PM



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

Online Users

Guests: 72
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