tangled
alpha
login
or
join now
bad-example.com
/
spacedust-utils
6
fork
atom
demos for spacedust
6
fork
atom
overview
issues
pulls
pipelines
whatever sketchy whatever
bad-example.com
8 months ago
68593ed6
64588a51
+2
-1
1 changed file
expand all
collapse all
unified
split
server
index.js
+2
-1
server/index.js
···
183
183
}
184
184
};
185
185
186
186
+
// never EVER allow user-controllable input into fname (or just fix the path joining)
186
187
const handleFile = (fname, ftype) => async (req, res, replace = {}) => {
187
188
let content
188
189
try {
189
189
-
content = await fs.promises.readFile(import.meta.dirname + '/web-content/' + fname);
190
190
+
content = await fs.promises.readFile(`./web-content/${fname}`); // DANGERDANGER
190
191
content = content.toString();
191
192
} catch (err) {
192
193
console.error(err);