don't respond with 304 on error when debugging is enabled

This commit is contained in:
jomo
2016-11-07 04:08:19 +01:00
parent f1f3ba6709
commit c02d3d33e9
2 changed files with 5 additions and 1 deletions

View File

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