respond 304 on server error, fixes #135

This commit is contained in:
jomo
2016-01-20 01:50:30 +01:00
parent 9ccb0151bc
commit e7242ce773
2 changed files with 14 additions and 1 deletions

View File

@@ -68,7 +68,8 @@ module.exports = function(request, response, result) {
// handle etag caching
var incoming_etag = request.headers["if-none-match"];
if (incoming_etag && incoming_etag === etag) {
// also respond with 304 on server error (use client's version)
if (incoming_etag && (incoming_etag === etag || result.status === -1)) {
response.writeHead(304, headers);
response.end();
return;