forked from cory/tildefriends
js: Remove some unused code.
This commit is contained in:
39
core/core.js
39
core/core.js
@ -812,45 +812,6 @@ async function getProcessBlob(blobId, key, options) {
|
||||
return process;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODOC
|
||||
* @param {*} response
|
||||
* @param {*} data
|
||||
* @param {*} type
|
||||
* @param {*} headers
|
||||
* @param {*} status_code
|
||||
*/
|
||||
function sendData(response, data, type, headers, status_code) {
|
||||
if (data) {
|
||||
response.writeHead(
|
||||
status_code ?? 200,
|
||||
Object.assign(
|
||||
{
|
||||
'Content-Type':
|
||||
type ||
|
||||
httpd.mime_type_from_magic_bytes(data) ||
|
||||
'application/binary',
|
||||
'Content-Length': data.byteLength,
|
||||
},
|
||||
headers || {}
|
||||
)
|
||||
);
|
||||
response.end(data);
|
||||
} else {
|
||||
response.writeHead(
|
||||
status_code ?? 404,
|
||||
Object.assign(
|
||||
{
|
||||
'Content-Type': 'text/plain; charset=utf-8',
|
||||
'Content-Length': 'File not found'.length,
|
||||
},
|
||||
headers || {}
|
||||
)
|
||||
);
|
||||
response.end('File not found');
|
||||
}
|
||||
}
|
||||
|
||||
ssb.addEventListener('message', function () {
|
||||
broadcastEvent('onMessage', [...arguments]);
|
||||
});
|
||||
|
Reference in New Issue
Block a user