Fix response mojibake, while SVR.JS is running on Bun

This commit is contained in:
Dorian Niemiec 2024-05-03 16:06:34 +02:00
parent 7c4121c55d
commit 4af71a094d

View file

@ -465,7 +465,7 @@ Mod.prototype.callback = function (req, res, serverconsole, responseEnd, href, e
try {
res.writeHead(code, msg, bheaderso);
res.write(buffer.substr(headerendline + eol.length), "latin1");
res.write(Buffer.from(buffer.substr(headerendline + eol.length), "latin1"));
} catch (ex) {
handler.removeAllListeners("exit");
handler.stdout.removeAllListeners("data");