mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-23 11:38:37 +00:00
fix: char encoding
This commit is contained in:
parent
2fbd9a3d54
commit
7d8cb59a7a
@ -68,12 +68,13 @@ const server = http.createServer(async (req, res) => {
|
|||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
return res.end(JSON.stringify(banks));
|
return res.end(JSON.stringify(banks));
|
||||||
}
|
}
|
||||||
if (!files.includes(req.url)) {
|
let subpath = decodeURIComponent(req.url);
|
||||||
|
if (!files.includes(subpath)) {
|
||||||
res.statusCode = 404;
|
res.statusCode = 404;
|
||||||
res.end('File not found');
|
res.end('File not found');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const filePath = join(directory, req.url);
|
const filePath = join(directory, subpath);
|
||||||
const readStream = createReadStream(filePath);
|
const readStream = createReadStream(filePath);
|
||||||
readStream.on('error', (err) => {
|
readStream.on('error', (err) => {
|
||||||
res.statusCode = 500;
|
res.statusCode = 500;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user