Skip to content

Commit b7c9b5d

Browse files
committed
http: do not use llhttp indexes for array
1 parent eff5939 commit b7c9b5d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/node_http_parser.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1288,9 +1288,11 @@ void InitializeHttpParser(Local<Object> target,
12881288
Integer::NewFromUnsigned(env->isolate(), kLenientAll));
12891289

12901290
Local<Array> methods = Array::New(env->isolate());
1291+
size_t method_index = -1;
12911292
#define V(num, name, string) \
12921293
methods->Set(env->context(), \
1293-
num, FIXED_ONE_BYTE_STRING(env->isolate(), #string)).Check();
1294+
++method_index, \
1295+
FIXED_ONE_BYTE_STRING(env->isolate(), #string)).Check();
12941296
HTTP_METHOD_MAP(V)
12951297
#undef V
12961298
target->Set(env->context(),

test/parallel/test-http-methods.js

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const methods = [
5252
'PROPPATCH',
5353
'PURGE',
5454
'PUT',
55+
'QUERY',
5556
'REBIND',
5657
'REPORT',
5758
'SEARCH',

0 commit comments

Comments
 (0)