mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-05-11 15:16:28 +02:00
Minify: Don't set cache headers if statFile() causes 500
This commit is contained in:
parent
84190793dc
commit
3eefe71834
@ -146,6 +146,11 @@ const minify = (req, res) => {
|
||||
const contentType = mime.lookup(filename);
|
||||
|
||||
util.callbackify(statFile)(filename, 3, (error, [date, exists]) => {
|
||||
if (error) {
|
||||
res.writeHead(500, {});
|
||||
res.end();
|
||||
return;
|
||||
}
|
||||
if (date) {
|
||||
date = new Date(date);
|
||||
date.setMilliseconds(0);
|
||||
@ -158,10 +163,7 @@ const minify = (req, res) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (error) {
|
||||
res.writeHead(500, {});
|
||||
res.end();
|
||||
} else if (!exists) {
|
||||
if (!exists) {
|
||||
res.writeHead(404, {});
|
||||
res.end();
|
||||
} else if (new Date(req.headers['if-modified-since']) >= date) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user