Use latin1 in getHeader

This commit is contained in:
Alex Hultman 2022-01-19 03:08:15 +01:00 committed by GitHub
parent c3bdbf4cca
commit 4ac42ec21b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,7 +86,8 @@ struct HttpRequestWrapper {
std::string_view header = req->getHeader(data.getString());
args.GetReturnValue().Set(String::NewFromUtf8(isolate, header.data(), NewStringType::kNormal, header.length()).ToLocalChecked());
/* We want latin1 here */
args.GetReturnValue().Set(String::NewFromOneByte(isolate, (const uint8_t *)header.data(), NewStringType::kNormal, header.length()).ToLocalChecked());
}
}