Skip to content

Commit

Permalink
Merge pull request #2596 from vector-im/rav/cachebust_version
Browse files Browse the repository at this point in the history
Add a cachebuster to /version
  • Loading branch information
richvdh committed Nov 17, 2016
2 parents dace762 + 646608b commit 6d954ad
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/vector/platform/WebPlatform.js
Expand Up @@ -128,8 +128,18 @@ export default class WebPlatform extends VectorBasePlatform {

_getVersion() {
const deferred = q.defer();

// We add a cachebuster to the request to make sure that we know about
// the most recent version on the origin server. That might not
// actually be the version we'd get on a reload (particularly in the
// presence of intermediate caching proxies), but still: we're trying
// to tell the user that there is a new version.
request(
{ method: "GET", url: "version" },
{
method: "GET",
url: "version",
qs: { cachebuster: Date.now() },
},
(err, response, body) => {
if (err || response.status < 200 || response.status >= 300) {
if (err == null) err = { status: response.status };
Expand Down

0 comments on commit 6d954ad

Please sign in to comment.