Move path conversion to general utilities

This commit is contained in:
D. Berge
2023-09-23 13:44:16 +02:00
parent 056cd32f0e
commit c5b93794f4
3 changed files with 4 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
const fs = require('fs/promises');
const Path = require('path');
const mime = require('./mime-types');
const { translatePath, logicalRoot } = require('./logical');
const { translatePath, logicalRoot } = require('../utils/logicalPath');
const systemCfg = require('../config');
const projectCfg = require('../db/configuration');

View File

@@ -5,5 +5,6 @@ module.exports = {
replaceMarkers: require('./replaceMarkers'),
flattenQCDefinitions: require('./flattenQCDefinitions'),
deepMerge: require('./deepMerge'),
removeNulls: require('./removeNulls')
removeNulls: require('./removeNulls'),
logicalPath: require('./logicalPath')
};

View File

@@ -10,6 +10,7 @@ function translatePath (file) {
return physicalPath;
} else {
// An attempt to break out of the logical path?
console.warn("Attempting to break out of the logical path?", physicalPath, prefix);
throw {
status: 404,
message: "Not found"