summaryrefslogtreecommitdiffhomepage
path: root/src/nodejs/unit-http/unit.cpp
diff options
context:
space:
mode:
authorDan Callahan <d.callahan@f5.com>2024-02-27 15:15:42 +0000
committerDan Callahan <d.callahan@f5.com>2024-02-27 15:15:42 +0000
commitd76761901c4084bcdbc5a449e9bbb47d56b7093c (patch)
treeb4b7b4e3d588b73a2adcc0094cab466d9194c679 /src/nodejs/unit-http/unit.cpp
parentc43629880472bba8d389dfb0b7ae6d883b0ba499 (diff)
parent088117008c9e8f397a58cc8d8070ce047beff12f (diff)
downloadunit-d76761901c4084bcdbc5a449e9bbb47d56b7093c.tar.gz
unit-d76761901c4084bcdbc5a449e9bbb47d56b7093c.tar.bz2
Merge tag '1.32.0' into branches/packaging1.32.0-1
Unit 1.32.0 release.
Diffstat (limited to 'src/nodejs/unit-http/unit.cpp')
-rw-r--r--src/nodejs/unit-http/unit.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nodejs/unit-http/unit.cpp b/src/nodejs/unit-http/unit.cpp
index 7912d0ac..7d9395bb 100644
--- a/src/nodejs/unit-http/unit.cpp
+++ b/src/nodejs/unit-http/unit.cpp
@@ -581,6 +581,7 @@ Unit::get_server_object()
void
Unit::create_headers(nxt_unit_request_info_t *req, napi_value request)
{
+ char *p;
uint32_t i;
napi_value headers, raw_headers;
napi_status status;
@@ -602,7 +603,12 @@ Unit::create_headers(nxt_unit_request_info_t *req, napi_value request)
set_named_property(request, "headers", headers);
set_named_property(request, "rawHeaders", raw_headers);
- set_named_property(request, "httpVersion", r->version, r->version_length);
+
+ // trim the "HTTP/" protocol prefix
+ p = (char *) nxt_unit_sptr_get(&r->version);
+ p += 5;
+
+ set_named_property(request, "httpVersion", create_string_latin1(p, 3));
set_named_property(request, "method", r->method, r->method_length);
set_named_property(request, "url", r->target, r->target_length);