Skip to content

Commit

Permalink
fixes #18898, add timeout option to JsonRest store
Browse files Browse the repository at this point in the history
  • Loading branch information
dylans committed Feb 9, 2017
1 parent eaff9ef commit 3cd736a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions store/JsonRest.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ return declare("dojo.store.JsonRest", base, {
return xhr("GET", {
url: this._getTarget(id),
handleAs: "json",
headers: headers
headers: headers,
timeout: options && options.timeout
});
},

Expand Down Expand Up @@ -133,7 +134,8 @@ return declare("dojo.store.JsonRest", base, {
Accept: this.accepts,
"If-Match": options.overwrite === true ? "*" : null,
"If-None-Match": options.overwrite === false ? "*" : null
}, this.headers, options.headers)
}, this.headers, options.headers),
timeout: options && options.timeout
});
},

Expand Down Expand Up @@ -161,7 +163,8 @@ return declare("dojo.store.JsonRest", base, {
options = options || {};
return xhr("DELETE", {
url: this._getTarget(id),
headers: lang.mixin({}, this.headers, options.headers)
headers: lang.mixin({}, this.headers, options.headers),
timeout: options && options.timeout
});
},

Expand Down Expand Up @@ -210,7 +213,8 @@ return declare("dojo.store.JsonRest", base, {
var results = xhr("GET", {
url: this.target + (query || ""),
handleAs: "json",
headers: headers
headers: headers,
timeout: options && options.timeout
});
results.total = results.then(function(){
var range = results.ioArgs.xhr.getResponseHeader("Content-Range");
Expand Down

0 comments on commit 3cd736a

Please sign in to comment.