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

This commit is contained in:
Dorian Niemiec 2024-05-03 16:08:48 +02:00
parent 1680398db2
commit f8234d0d1c

View file

@ -151,7 +151,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) {
socket.removeAllListeners("data");
socket.removeAllListeners("end");