mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-04-13 09:42:01 +00:00
Switching node from .send to .sendStatus.
This commit is contained in:
parent
2c24866fe0
commit
81ffcc52dc
2 changed files with 6 additions and 6 deletions
|
@ -25,12 +25,12 @@ original_page = (app) =>
|
|||
log.debug "Loading: #{feedId} (#{filePath}). " +
|
||||
"#{if exists then "" else "NOT FOUND"}"
|
||||
if not exists
|
||||
return res.send 404
|
||||
return res.sendStatus 404
|
||||
fs.stat filePath, (err, stats) ->
|
||||
if not err and etag and stats.mtime == etag
|
||||
return res.send 304
|
||||
return res.sendStatus 304
|
||||
if not err and lastModified and stats.mtime == lastModified
|
||||
return res.send 304
|
||||
return res.sendStatus 304
|
||||
|
||||
fs.readFile filePath, (err, content) ->
|
||||
res.header 'Etag', Date.parse(stats.mtime)
|
||||
|
|
|
@ -30,14 +30,14 @@
|
|||
return fs.exists(filePath, function(exists, err) {
|
||||
log.debug(`Loading: ${feedId} (${filePath}). ` + `${exists ? "" : "NOT FOUND"}`);
|
||||
if (!exists) {
|
||||
return res.send(404);
|
||||
return res.sendStatus(404);
|
||||
}
|
||||
return fs.stat(filePath, function(err, stats) {
|
||||
if (!err && etag && stats.mtime === etag) {
|
||||
return res.send(304);
|
||||
return res.sendStatus(304);
|
||||
}
|
||||
if (!err && lastModified && stats.mtime === lastModified) {
|
||||
return res.send(304);
|
||||
return res.sendStatus(304);
|
||||
}
|
||||
return fs.readFile(filePath, function(err, content) {
|
||||
res.header('Etag', Date.parse(stats.mtime));
|
||||
|
|
Loading…
Add table
Reference in a new issue