From aaa21daa29f0d72300001249c800b32a775cb0b1 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 26 Feb 2018 23:18:03 -0500 Subject: [PATCH] only intercept with headers when api is at start --- src/app/apiInterceptor.js | 2 +- src/app/config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/apiInterceptor.js b/src/app/apiInterceptor.js index f6f7d1c8..76a79c22 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 ce78fb64..afd3bc32 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; }