diff --git a/src/addon.cpp b/src/addon.cpp index 95ca926..204086e 100644 --- a/src/addon.cpp +++ b/src/addon.cpp @@ -91,11 +91,13 @@ void uWS_getParts(const FunctionCallbackInfo &args) { Local parts = Array::New(args.GetIsolate(), 0); while (true) { - std::string_view part = mp.getNextPart(headers); - if (!part.length()) { + std::optional optionalPart = mp.getNextPart(headers); + if (!optionalPart.has_value()) { break; } + std::string_view part = optionalPart.value(); + Local partArrayBuffer = ArrayBuffer::New(isolate, (void *) part.data(), part.length()); Local partMap = Map::New(isolate); partMap->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "data", NewStringType::kNormal).ToLocalChecked(), partArrayBuffer); diff --git a/uWebSockets b/uWebSockets index 70d0605..59a38b3 160000 --- a/uWebSockets +++ b/uWebSockets @@ -1 +1 @@ -Subproject commit 70d060597ef45366c2e0d906e052b091fbb466a7 +Subproject commit 59a38b3a1316eba2a0dd986f6ae6834f6260aa07