From 4ac42ec21b2bb8d9bb8214671b95ca107c0d9071 Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Wed, 19 Jan 2022 03:08:15 +0100 Subject: [PATCH] Use latin1 in getHeader --- src/HttpRequestWrapper.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/HttpRequestWrapper.h b/src/HttpRequestWrapper.h index 6daaed8..1345c2e 100644 --- a/src/HttpRequestWrapper.h +++ b/src/HttpRequestWrapper.h @@ -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()); } }