Skip to content

Commit

Permalink
Don't cache responses in FailoverUri.
Browse files Browse the repository at this point in the history
Issue #184

Change-Id: If7137f96ac4994d593615ef6baecadb668218403
  • Loading branch information
Timothy Drews committed Sep 23, 2015
1 parent 638b9a1 commit 1fac67c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/util/failover_uri.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ shaka.util.FailoverUri.resolve = function(baseUrl, url) {
shaka.util.FailoverUri.prototype.fetch =
function(opt_parameters, opt_estimator) {
if (this.requestPromise_) {
// A fetch has already completed or is in progress.
// A fetch is already in progress.
return this.requestPromise_;
}

Expand Down Expand Up @@ -153,6 +153,9 @@ shaka.util.FailoverUri.prototype.createRequest_ =
var p = this.request_.send().then(shaka.util.TypedBind(this,
/** @param {!XMLHttpRequest} xhr */
function(xhr) {
// |requestPromise_| MUST be set to null; otherwise, we will
// effectively cache every response.
this.requestPromise_ = null;
this.request_ = null;
return Promise.resolve(xhr.response);
}));
Expand Down

0 comments on commit 1fac67c

Please sign in to comment.