1
0

check if correlationid exists before adding it as a header

This commit is contained in:
Art Lowel
2021-07-26 11:54:25 +02:00
parent e9a03994e2
commit 8f43fbd399

View File

@@ -5,6 +5,7 @@ import { Router } from '@angular/router';
import { Observable } from 'rxjs';
import { CookieService } from '../services/cookie.service';
import { hasValue } from '../../shared/empty.util';
/**
* Log Interceptor intercepting Http Requests & Responses to
@@ -23,7 +24,9 @@ export class LogInterceptor implements HttpInterceptor {
// Add headers from the intercepted request
let headers = request.headers;
if (hasValue(correlationId)) {
headers = headers.append('X-CORRELATION-ID', correlationId);
}
headers = headers.append('X-REFERRER', this.router.url);
// Add new headers to the intercepted request