71809: ForwardClientIpInterceptor

This commit is contained in:
Kristof De Langhe
2020-07-13 15:47:59 +02:00
parent 56d8a99c51
commit 0fa1e17078
4 changed files with 76 additions and 4 deletions

View File

@@ -27,9 +27,6 @@ export class ServerAuthService extends AuthService {
headers = headers.append('Accept', 'application/json');
headers = headers.append('Authorization', `Bearer ${token.accessToken}`);
// NB this is used to pass server client IP check.
const clientIp = this.req.get('x-forwarded-for') || this.req.connection.remoteAddress;
headers = headers.append('X-Forwarded-For', clientIp);
options.headers = headers;
return this.authRequestService.getRequest('status', options).pipe(