feat(http): allow caching for JSONP requests

Closes #1947
Closes #8356
This commit is contained in:
Shahar Talmi
2014-07-26 23:29:59 +03:00
committed by Peter Bacon Darwin
parent 986c446aaf
commit eab5731afc
2 changed files with 14 additions and 1 deletions

View File

@@ -945,7 +945,8 @@ function $HttpProvider() {
promise.then(removePendingReq, removePendingReq);
if ((config.cache || defaults.cache) && config.cache !== false && config.method == 'GET') {
if ((config.cache || defaults.cache) && config.cache !== false &&
(config.method === 'GET' || config.method === 'JSONP')) {
cache = isObject(config.cache) ? config.cache
: isObject(defaults.cache) ? defaults.cache
: defaultCache;