Fix up warning and update Buffer() to Buffer.from()

This commit is contained in:
Bryan Ashby 2023-04-26 21:40:37 -06:00
parent a5a3a63b00
commit d5bffb1719
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
4 changed files with 7 additions and 4 deletions

View File

@ -1622,6 +1622,9 @@ function FTNMessageScanTossModule() {
const addrString = new Address(
packetHeader.destAddress
).toString();
importStats.otherFail += 1;
return next(
new Error(
`No local configuration for packet addressed to ${addrString}`

View File

@ -273,7 +273,7 @@ exports.getModule = class WebServerModule extends ServerModule {
ok(resp, body = '', headers = { 'Content-Type': 'text/html' }) {
if (body && !headers['Content-Length']) {
headers['Content-Length'] = Buffer(body).length;
headers['Content-Length'] = Buffer.from(body).length;
}
resp.writeHead(200, 'OK', body ? headers : null);
return resp.end(body);

View File

@ -52,7 +52,7 @@ exports.getModule = class NodeInfo2WebHandler extends WebHandlerModule {
const body = JSON.stringify(nodeInfo);
const headers = {
'Content-Type': 'application/json',
'Content-Length': Buffer(body).length,
'Content-Length': Buffer.from(body).length,
};
resp.writeHead(200, headers);

View File

@ -117,7 +117,7 @@ exports.getModule = class WebFingerWebHandler extends WebHandlerModule {
const headers = {
'Content-Type': contentType,
'Content-Length': Buffer(body).length,
'Content-Length': Buffer.from(body).length,
};
resp.writeHead(200, headers);
@ -168,7 +168,7 @@ exports.getModule = class WebFingerWebHandler extends WebHandlerModule {
const headers = {
'Content-Type': 'application/jrd+json',
'Content-Length': Buffer(body).length,
'Content-Length': Buffer.from(body).length,
};
resp.writeHead(200, headers);