Fix various Content-Lenght's
This commit is contained in:
parent
a829905c63
commit
98d37e9564
|
@ -46,7 +46,7 @@ function postJson(url, json, options, cb) {
|
|||
|
||||
function _makeRequest(url, options, cb) {
|
||||
if (options.body) {
|
||||
options.headers['Content-Length'] = options.body.length;
|
||||
options.headers['Content-Length'] = Buffer(options.body).length;
|
||||
|
||||
if (options?.sign?.headers?.includes('digest')) {
|
||||
options.headers['Digest'] =
|
||||
|
|
|
@ -415,7 +415,7 @@ exports.getModule = class ActivityPubWebHandler extends WebHandlerModule {
|
|||
const body = JSON.stringify(collection);
|
||||
const headers = {
|
||||
'Content-Type': ActivityStreamMediaType,
|
||||
'Content-Length': body.length,
|
||||
'Content-Length': Buffer(body).length,
|
||||
};
|
||||
|
||||
resp.writeHead(200, headers);
|
||||
|
@ -715,7 +715,7 @@ exports.getModule = class ActivityPubWebHandler extends WebHandlerModule {
|
|||
|
||||
const headers = {
|
||||
'Content-Type': ActivityStreamMediaType,
|
||||
'Content-Length': body.length,
|
||||
'Content-Length': Buffer(body).length,
|
||||
};
|
||||
|
||||
resp.writeHead(200, headers);
|
||||
|
@ -746,7 +746,7 @@ exports.getModule = class ActivityPubWebHandler extends WebHandlerModule {
|
|||
|
||||
const headers = {
|
||||
'Content-Type': contentType,
|
||||
'Content-Length': body.length,
|
||||
'Content-Length': Buffer(body).length,
|
||||
};
|
||||
|
||||
resp.writeHead(200, headers);
|
||||
|
|
|
@ -51,7 +51,7 @@ exports.getModule = class NodeInfo2WebHadnler extends WebHandlerModule {
|
|||
const body = JSON.stringify(nodeInfo);
|
||||
const headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'Content-Length': body.length,
|
||||
'Content-Length': Buffer(body).length,
|
||||
};
|
||||
|
||||
resp.writeHead(200, headers);
|
||||
|
|
|
@ -124,7 +124,7 @@ exports.getModule = class WebFingerWebHandler extends WebHandlerModule {
|
|||
|
||||
const headers = {
|
||||
'Content-Type': contentType,
|
||||
'Content-Length': body.length,
|
||||
'Content-Length': Buffer(body).length,
|
||||
};
|
||||
|
||||
resp.writeHead(200, headers);
|
||||
|
@ -176,7 +176,7 @@ exports.getModule = class WebFingerWebHandler extends WebHandlerModule {
|
|||
|
||||
const headers = {
|
||||
'Content-Type': 'application/jrd+json',
|
||||
'Content-Length': body.length,
|
||||
'Content-Length': Buffer(body).length,
|
||||
};
|
||||
|
||||
resp.writeHead(200, headers);
|
||||
|
|
Loading…
Reference in New Issue