diff --git a/src/HttpRequestWrapper.h b/src/HttpRequestWrapper.h index 5981aa0..5872ec8 100644 --- a/src/HttpRequestWrapper.h +++ b/src/HttpRequestWrapper.h @@ -100,7 +100,19 @@ struct HttpRequestWrapper { Isolate *isolate = args.GetIsolate(); auto *req = getHttpRequest(args); if (req) { - std::string_view query = req->getQuery(); + std::string_view query; + + /* Do we have a key argument? */ + if (args.Length() == 1) { + NativeString keyString(isolate, args[0]); + if (keyString.isInvalid(args)) { + return; + } + + query = req->getQuery(keyString.getString()); + } else { + query = req->getQuery(); + } args.GetReturnValue().Set(String::NewFromUtf8(isolate, query.data(), NewStringType::kNormal, query.length()).ToLocalChecked()); } diff --git a/uWebSockets b/uWebSockets index 270308f..7c61122 160000 --- a/uWebSockets +++ b/uWebSockets @@ -1 +1 @@ -Subproject commit 270308f10446c55b4a8c3c6ada62f81e77e1917c +Subproject commit 7c61122a1a930b72667193363ad39d45f1a7b435