Fix up warning and update Buffer() to Buffer.from()
This commit is contained in:
parent
a5a3a63b00
commit
d5bffb1719
|
@ -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}`
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue