type-guard vs possible null
This commit is contained in:
parent
6bd77bac7a
commit
37e20f6fc5
|
@ -4704,7 +4704,7 @@ app.post('/import_custom', jsonParser, async (request, response) => {
|
||||||
return response.sendStatus(404);
|
return response.sendStatus(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
response.set('Content-Type', result.fileType);
|
if (result.fileType) response.set('Content-Type', result.fileType)
|
||||||
response.set('Content-Disposition', `attachment; filename="${result.fileName}"`);
|
response.set('Content-Disposition', `attachment; filename="${result.fileName}"`);
|
||||||
response.set('X-Custom-Content-Type', chubParsed?.type);
|
response.set('X-Custom-Content-Type', chubParsed?.type);
|
||||||
return response.send(result.buffer);
|
return response.send(result.buffer);
|
||||||
|
|
Loading…
Reference in New Issue