mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 10:28:49 -07:00
Merge pull request #2195 from calmh/noreload
Don't trust response header (fixes #2186)
This commit is contained in:
commit
037be433f8
@ -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) {
|
||||
|
@ -89,6 +89,12 @@ angular.module('syncthing.core')
|
||||
refreshFolderStats();
|
||||
|
||||
$http.get(urlbase + '/system/version').success(function (data) {
|
||||
if ($scope.version.version && $scope.version.version != data.version) {
|
||||
// We already have a version response, but it differs from
|
||||
// the new one. Reload the full GUI in case it's changed.
|
||||
document.location.reload(true);
|
||||
}
|
||||
|
||||
$scope.version = data;
|
||||
}).error($scope.emitHTTPError);
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user