aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/http.js
diff options
context:
space:
mode:
authorjankuca2013-08-29 18:52:30 -0700
committerIgor Minar2013-09-02 11:47:51 +0200
commit8e48c4ff6abf7083a04cf20312d2b106f4ba5b2c (patch)
tree3b8e90aff3c75365e947faa18a3f6a2077d6e430 /src/ng/http.js
parent44ad61e56c04f445d059048838d8de3adbc63090 (diff)
downloadangular.js-8e48c4ff6abf7083a04cf20312d2b106f4ba5b2c.tar.bz2
fix($http): allow empty responses to be cached
Closes #3809
Diffstat (limited to 'src/ng/http.js')
-rw-r--r--src/ng/http.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ng/http.js b/src/ng/http.js
index ab4900de..443daf83 100644
--- a/src/ng/http.js
+++ b/src/ng/http.js
@@ -892,7 +892,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);
@@ -912,7 +912,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, config.responseType);
}