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(
|
const addrString = new Address(
|
||||||
packetHeader.destAddress
|
packetHeader.destAddress
|
||||||
).toString();
|
).toString();
|
||||||
|
|
||||||
|
importStats.otherFail += 1;
|
||||||
|
|
||||||
return next(
|
return next(
|
||||||
new Error(
|
new Error(
|
||||||
`No local configuration for packet addressed to ${addrString}`
|
`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' }) {
|
ok(resp, body = '', headers = { 'Content-Type': 'text/html' }) {
|
||||||
if (body && !headers['Content-Length']) {
|
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);
|
resp.writeHead(200, 'OK', body ? headers : null);
|
||||||
return resp.end(body);
|
return resp.end(body);
|
||||||
|
|
|
@ -52,7 +52,7 @@ exports.getModule = class NodeInfo2WebHandler extends WebHandlerModule {
|
||||||
const body = JSON.stringify(nodeInfo);
|
const body = JSON.stringify(nodeInfo);
|
||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Content-Length': Buffer(body).length,
|
'Content-Length': Buffer.from(body).length,
|
||||||
};
|
};
|
||||||
|
|
||||||
resp.writeHead(200, headers);
|
resp.writeHead(200, headers);
|
||||||
|
|
|
@ -117,7 +117,7 @@ exports.getModule = class WebFingerWebHandler extends WebHandlerModule {
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': contentType,
|
'Content-Type': contentType,
|
||||||
'Content-Length': Buffer(body).length,
|
'Content-Length': Buffer.from(body).length,
|
||||||
};
|
};
|
||||||
|
|
||||||
resp.writeHead(200, headers);
|
resp.writeHead(200, headers);
|
||||||
|
@ -168,7 +168,7 @@ exports.getModule = class WebFingerWebHandler extends WebHandlerModule {
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': 'application/jrd+json',
|
'Content-Type': 'application/jrd+json',
|
||||||
'Content-Length': Buffer(body).length,
|
'Content-Length': Buffer.from(body).length,
|
||||||
};
|
};
|
||||||
|
|
||||||
resp.writeHead(200, headers);
|
resp.writeHead(200, headers);
|
||||||
|
|
Loading…
Reference in New Issue