headers: {
'content-type': 'text/plain',
link: '<https://example.com/hub/>; rel="hub"',
+ 'last-modified': 'Thu, 18 Nov 2021 20:34:35 GMT',
+ 'etag': '"9c104-1673e-5d1161636d742"',
},
data: 'Jackdaws love my big sphinx of quartz.',
});
assert(!communication.db.topicSetContent.called);
});
+ it('recognizes 304 response', async function () {
+ topic.httpLastModified = 'Thu, 18 Nov 2021 20:34:35 GMT';
+ topic.httpEtag = '"9c104-1673e-5d1161636d742"';
+ communication.db.topicGetById.resolves(topic);
+ communication.axios.resolves({
+ status: 304,
+ });
+
+ await communication.topicFetchProcess(dbCtx, topicId, requestId);
+
+ assert(communication.db.topicFetchComplete.called);
+ assert(!communication.db.topicSetContent.called);
+ });
+
it('updates content', async function () {
await communication.topicFetchProcess(dbCtx, topicId, requestId);