From 2a3212a0a333ee4c0640c6b6d63d3c5c34a81c70 Mon Sep 17 00:00:00 2001 From: jankuca Date: Thu, 29 Aug 2013 18:52:30 -0700 Subject: fix($http): allow empty responses to be cached Closes #3809 --- src/ng/http.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ng') diff --git a/src/ng/http.js b/src/ng/http.js index 40ebfca2..85068ff6 100644 --- a/src/ng/http.js +++ b/src/ng/http.js @@ -706,7 +706,7 @@ function $HttpProvider() { if (cache) { cachedResp = cache.get(url); - if (cachedResp) { + if (isDefined(cachedResp)) { if (cachedResp.then) { // cached request has already been sent, but there is no response yet cachedResp.then(removePendingReq, removePendingReq); @@ -726,7 +726,7 @@ function $HttpProvider() { } // if we won't have the response in cache, send the request to the backend - if (!cachedResp) { + if (isUndefined(cachedResp)) { $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, config.withCredentials); } -- cgit v1.2.3