Add test for immutable content

This commit is contained in:
nolash
2021-10-19 12:36:17 +02:00
parent b05fc43086
commit 341a7eebec
3 changed files with 86 additions and 42 deletions

View File

@@ -37,7 +37,6 @@ function handleNoMergeGet(db, digest, keystore) {
format: 'binary',
};
pgp.decrypt(opts).then((plainText) => {
console.debug('immutable ', rs.rows[0]['owner_fingerprint'], immutable);
let r;
if (immutable) {
r = plainText.data;

View File

@@ -174,7 +174,6 @@ async function processRequest(req, res) {
}
});
req.on('end', async (d) => {
console.debug('hedaers ', req.headers);
let inputContentType = req.headers['content-type'];
let debugString = 'executing mode ' + mod ;
if (data !== undefined) {
@@ -211,6 +210,7 @@ async function processRequest(req, res) {
res.end();
return;
}
content = '';
break;
//case 'get:automerge:server':
// content = await handlers.handleServerMergeGet(db, digest, keystore);
@@ -262,6 +262,9 @@ async function processRequest(req, res) {
// (new TextEncoder().encode(content)).length;
//}
const responseContentLength = content.length;
//if (responseContentLength === undefined) {
// responseContentLength = 0;
//}
res.writeHead(statusCode, {
"Access-Control-Allow-Origin": "*",
"Content-Type": contentType,