Skip to content

Commit

Permalink
task/WG-140: add app information to request for analytics-related log…
Browse files Browse the repository at this point in the history
…ging (#170)

* Add information on what app is making this request

* Fix linting
  • Loading branch information
nathanfranklin authored Nov 30, 2023
1 parent e9dd0be commit 562e291
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions angular/src/app/app.interceptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 562e291

Please sign in to comment.