Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 521202 - PUT request using "If-Match" for a deleted file returns …
…wrong status code
  • Loading branch information
mrennie committed Aug 21, 2017
1 parent fae5adb commit a5f68cc
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions modules/orionode/lib/file.js
Expand Up @@ -241,13 +241,12 @@ module.exports = function(options) {
return write();
}
fileUtil.withETag(file.path, function(error, etag) {
if (error && error.code === 'ENOENT') {
api.writeResponse(404, res);
} else if (ifMatchHeader && ifMatchHeader !== etag) {
api.writeResponse(412, res);
} else {
write();
if (ifMatchHeader && ifMatchHeader !== etag) {
return api.writeResponse(412, res);
} else if (error && error.code === 'ENOENT') {
return api.writeResponse(404, res);
}
write();
});
}

Expand Down

0 comments on commit a5f68cc

Please sign in to comment.