Fix sendFile usage
This commit is contained in:
parent
1c46d2740a
commit
27b6fe1f76
|
@ -5267,7 +5267,7 @@ app.post('/asset_download', jsonParser, async (request, response) => {
|
||||||
// Sanitize filename
|
// Sanitize filename
|
||||||
const safe_input = checkAssetFileName(inputFilename);
|
const safe_input = checkAssetFileName(inputFilename);
|
||||||
if (safe_input == '')
|
if (safe_input == '')
|
||||||
return response.sendFile('400');
|
return response.sendStatus(400);
|
||||||
|
|
||||||
const temp_path = path.join(directories.assets, "temp", safe_input)
|
const temp_path = path.join(directories.assets, "temp", safe_input)
|
||||||
const file_path = path.join(directories.assets, category, safe_input)
|
const file_path = path.join(directories.assets, category, safe_input)
|
||||||
|
@ -5329,7 +5329,7 @@ app.post('/asset_delete', jsonParser, async (request, response) => {
|
||||||
// Sanitize filename
|
// Sanitize filename
|
||||||
const safe_input = checkAssetFileName(inputFilename);
|
const safe_input = checkAssetFileName(inputFilename);
|
||||||
if (safe_input == '')
|
if (safe_input == '')
|
||||||
return response.sendFile('400');
|
return response.sendStatus(400);
|
||||||
|
|
||||||
const file_path = path.join(directories.assets, category, safe_input)
|
const file_path = path.join(directories.assets, category, safe_input)
|
||||||
console.debug("Request received to delete", category, file_path);
|
console.debug("Request received to delete", category, file_path);
|
||||||
|
|
Loading…
Reference in New Issue