Don't trust response header (fixes #2186)
Either Angular or the browser sometimes returns cached repsonse header, causing a flap between requests that return the new version and requests that return the old one. Here, instead, we trust the actual data returned by the uncached /rest/system/version call.
This commit is contained in:
@@ -24,7 +24,6 @@ var urlbase = 'rest';
|
||||
|
||||
syncthing.config(function ($httpProvider, $translateProvider, LocaleServiceProvider) {
|
||||
$httpProvider.interceptors.push(function xHeadersResponseInterceptor() {
|
||||
var guiVersion = null;
|
||||
var deviceId = null;
|
||||
|
||||
return {
|
||||
@@ -38,14 +37,6 @@ syncthing.config(function ($httpProvider, $translateProvider, LocaleServiceProvi
|
||||
return response;
|
||||
}
|
||||
|
||||
responseVersion = headers['x-syncthing-version'];
|
||||
|
||||
if (!guiVersion) {
|
||||
guiVersion = responseVersion;
|
||||
} else if (guiVersion != responseVersion) {
|
||||
document.location.reload(true);
|
||||
}
|
||||
|
||||
if (!deviceId) {
|
||||
deviceId = headers['x-syncthing-id'];
|
||||
if (deviceId) {
|
||||
|
||||
Reference in New Issue
Block a user