From f77b2b055dd7c6b8d7564038eaf8c3cc13146f65 Mon Sep 17 00:00:00 2001 From: Nathan Franklin Date: Wed, 22 Nov 2023 14:51:11 -0600 Subject: [PATCH 1/2] Add information on what app is making this request --- angular/src/app/app.interceptors.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/angular/src/app/app.interceptors.ts b/angular/src/app/app.interceptors.ts index 0728b3fc..9901f781 100644 --- a/angular/src/app/app.interceptors.ts +++ b/angular/src/app/app.interceptors.ts @@ -54,6 +54,16 @@ export class JwtInterceptor implements HttpInterceptor { }); } + if(request.url.indexOf(this.envService.apiUrl) > -1) { + // Add information about what app is making the request + request = request.clone({ + setHeaders: { + 'X-Geoapi-Application': 'hazmapper', + }, + }); + } + + if ( request.url.indexOf(this.envService.streetviewEnv.mapillary.apiUrl) > -1 && !(request.url.indexOf(this.envService.streetviewEnv.mapillary.tokenUrl) > -1) From e342bb1e1cefc88f6cb3d49f5301a885070f24af Mon Sep 17 00:00:00 2001 From: Nathan Franklin Date: Wed, 22 Nov 2023 15:16:42 -0600 Subject: [PATCH 2/2] Fix linting --- angular/src/app/app.interceptors.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/angular/src/app/app.interceptors.ts b/angular/src/app/app.interceptors.ts index 9901f781..e8bd2f23 100644 --- a/angular/src/app/app.interceptors.ts +++ b/angular/src/app/app.interceptors.ts @@ -54,7 +54,7 @@ export class JwtInterceptor implements HttpInterceptor { }); } - if(request.url.indexOf(this.envService.apiUrl) > -1) { + if (request.url.indexOf(this.envService.apiUrl) > -1) { // Add information about what app is making the request request = request.clone({ setHeaders: { @@ -63,7 +63,6 @@ export class JwtInterceptor implements HttpInterceptor { }); } - if ( request.url.indexOf(this.envService.streetviewEnv.mapillary.apiUrl) > -1 && !(request.url.indexOf(this.envService.streetviewEnv.mapillary.tokenUrl) > -1)