From 562e2913851f3cf2745e73790292f536c302eee8 Mon Sep 17 00:00:00 2001 From: Nathan Franklin Date: Thu, 30 Nov 2023 09:46:20 -0600 Subject: [PATCH] task/WG-140: add app information to request for analytics-related logging (#170) * Add information on what app is making this request * Fix linting --- angular/src/app/app.interceptors.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/angular/src/app/app.interceptors.ts b/angular/src/app/app.interceptors.ts index 0728b3fc..e8bd2f23 100644 --- a/angular/src/app/app.interceptors.ts +++ b/angular/src/app/app.interceptors.ts @@ -54,6 +54,15 @@ 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)