diff --git a/src/app/apiInterceptor.js b/src/app/apiInterceptor.js index f6f7d1c81b..76a79c2255 100644 --- a/src/app/apiInterceptor.js +++ b/src/app/apiInterceptor.js @@ -4,7 +4,7 @@ angular .factory('apiInterceptor', function ($injector, $q, toastr, appSettings, utilsService) { return { request: function (config) { - if (config.url.indexOf(appSettings.apiUri + '/') > -1) { + if (config.url.indexOf(appSettings.apiUri + '/') === 0) { config.headers['Device-Type'] = utilsService.getDeviceType(); } diff --git a/src/app/config.js b/src/app/config.js index ce78fb6444..afd3bc32b1 100644 --- a/src/app/config.js +++ b/src/app/config.js @@ -20,7 +20,7 @@ angular var refreshPromise; jwtInterceptorProvider.tokenGetter = /*@ngInject*/ function (options, tokenService, authService) { - if (options.url.indexOf(appSettings.apiUri + '/') === -1) { + if (options.url.indexOf(appSettings.apiUri + '/') !== 0) { return; }