mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-30 22:34:10 -05:00
don't send etags with errors
This commit is contained in:
parent
9ee8d484db
commit
6a295ac196
1 changed files with 4 additions and 1 deletions
|
@ -110,7 +110,10 @@ module.exports.log_and_etagify = function(req, res, next) {
|
|||
body = JSON.stringify(body, undefined, '\t')
|
||||
}
|
||||
|
||||
res.header('ETag', '"' + md5sum(body) + '"')
|
||||
// don't send etags with errors
|
||||
if (!res.statusCode || (res.statusCode >= 200 && res.statusCode < 300)) {
|
||||
res.header('ETag', '"' + md5sum(body) + '"')
|
||||
}
|
||||
} else {
|
||||
// send(null), send(204), etc.
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue