From 47d702fede1703f8c084b0e53c43169731b9e740 Mon Sep 17 00:00:00 2001 From: ben hockey Date: Thu, 8 Jan 2015 17:31:13 -0600 Subject: [PATCH] allow count of 0 to be indicated fixes #32 --- jsgi/rest-store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsgi/rest-store.js b/jsgi/rest-store.js index 44db76f..245cd13 100644 --- a/jsgi/rest-store.js +++ b/jsgi/rest-store.js @@ -113,7 +113,7 @@ module.exports = function(options){ return responseValue && when(responseValue.totalCount, function(count){ delete responseValue.totalCount; var end = start + (responseValue.length || 0) - 1; - headers["content-range"] = "items " + start + '-' + end + '/' + (count || '*'); + headers["content-range"] = "items " + start + '-' + end + '/' + (count || count === 0 ? count : '*'); status = (start === 0 && count -1 === end) ? 200 : 206; return responseValue; });