i don't even know

This commit is contained in:
TheEssem 2021-05-02 12:00:41 -05:00
parent 56113a1cf8
commit 84e20308f2
2 changed files with 3 additions and 3 deletions

1
.gitignore vendored
View file

@ -29,7 +29,6 @@ typings/
.node_repl_history
*.tgz
.yarn-integrity
.env
.next
.ftpconfig
coverage.lcov

View file

@ -92,9 +92,10 @@ const httpServer = http.createServer((req, res) => {
}
log(`Sending image data for job ${id} to ${req.socket.remoteAddress}:${req.socket.remotePort} via HTTP`);
res.setHeader("ext", jobs.get(id).ext);
return res.end(jobs.get(id).data, (err) => {
const data = jobs.get(id).data;
jobs.delete(id);
return res.end(data, (err) => {
if (err) console.error(err);
jobs.delete(id);
});
} else {
res.statusCode = 404;