diff options
author | Alexander Borisov <alexander.borisov@nginx.com> | 2018-12-19 15:56:30 +0300 |
---|---|---|
committer | Alexander Borisov <alexander.borisov@nginx.com> | 2018-12-19 15:56:30 +0300 |
commit | dcf51274ce0953e577fbfffd81afb592319a2267 (patch) | |
tree | 50e9e7f893ec3103d61f6d66f6a54a4db5d7d256 /src/nodejs/unit-http/unit.cpp | |
parent | 607653c0f12a99981dbf3118b60b84ded4084d50 (diff) | |
download | unit-dcf51274ce0953e577fbfffd81afb592319a2267.tar.gz unit-dcf51274ce0953e577fbfffd81afb592319a2267.tar.bz2 |
Node.js: checking uniqueness of HTTP headers for different case.
Diffstat (limited to '')
-rw-r--r-- | src/nodejs/unit-http/unit.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/nodejs/unit-http/unit.cpp b/src/nodejs/unit-http/unit.cpp index b233359c..36bc98db 100644 --- a/src/nodejs/unit-http/unit.cpp +++ b/src/nodejs/unit-http/unit.cpp @@ -737,7 +737,7 @@ Unit::response_send_headers(napi_env env, napi_callback_info info) uint32_t keys_count, i, j; uint16_t hash; napi_value this_arg, headers, keys, name, value, array_val; - napi_value req_num; + napi_value req_num, array_entry; napi_status status; napi_valuetype val_type; nxt_unit_field_t *f; @@ -814,7 +814,17 @@ Unit::response_send_headers(napi_env env, napi_callback_info info) goto failed; } - status = napi_get_property(env, headers, name, &value); + status = napi_get_property(env, headers, name, &array_entry); + if (status != napi_ok) { + goto failed; + } + + status = napi_get_element(env, array_entry, 0, &name); + if (status != napi_ok) { + goto failed; + } + + status = napi_get_element(env, array_entry, 1, &value); if (status != napi_ok) { goto failed; } |