style(core): add simple flow, hoisting, stacktrace infos
This commit is contained in:
parent
dfcc166918
commit
e34be16237
@ -19,26 +19,32 @@ var guiVersion = null;
|
|||||||
var deviceId = null;
|
var deviceId = null;
|
||||||
|
|
||||||
syncthing.config(function ($httpProvider, $translateProvider, LocaleServiceProvider) {
|
syncthing.config(function ($httpProvider, $translateProvider, LocaleServiceProvider) {
|
||||||
$httpProvider.interceptors.push(function () {
|
$httpProvider.interceptors.push(function xHeadersResponseInterceptor() {
|
||||||
return {
|
return {
|
||||||
response: function (response) {
|
response: function onResponse(response) {
|
||||||
var headers = response.headers();
|
var headers = response.headers();
|
||||||
|
var responseVersion;
|
||||||
|
var deviceIdShort;
|
||||||
|
|
||||||
// angular template cache sends no headers
|
// angular template cache sends no headers
|
||||||
if(Object.keys(headers).length > 0) {
|
if(Object.keys(headers).length === 0) {
|
||||||
var responseVersion = headers['x-syncthing-version'];
|
return response;
|
||||||
if (!guiVersion) {
|
}
|
||||||
guiVersion = responseVersion;
|
|
||||||
} else if (guiVersion != responseVersion) {
|
responseVersion = headers['x-syncthing-version'];
|
||||||
document.location.reload(true);
|
|
||||||
}
|
if (!guiVersion) {
|
||||||
if (!deviceId) {
|
guiVersion = responseVersion;
|
||||||
deviceId = headers['x-syncthing-id'];
|
} else if (guiVersion != responseVersion) {
|
||||||
if (deviceId) {
|
document.location.reload(true);
|
||||||
var deviceIdShort = deviceId.substring(0, 5);
|
}
|
||||||
$httpProvider.defaults.xsrfHeaderName = 'X-CSRF-Token-' + deviceIdShort;
|
|
||||||
$httpProvider.defaults.xsrfCookieName = 'CSRF-Token-' + deviceIdShort;
|
if (!deviceId) {
|
||||||
}
|
deviceId = headers['x-syncthing-id'];
|
||||||
|
if (deviceId) {
|
||||||
|
deviceIdShort = deviceId.substring(0, 5);
|
||||||
|
$httpProvider.defaults.xsrfHeaderName = 'X-CSRF-Token-' + deviceIdShort;
|
||||||
|
$httpProvider.defaults.xsrfCookieName = 'CSRF-Token-' + deviceIdShort;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user