mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
Added a fallback for x-forwarded-for header
This commit is contained in:
@@ -28,7 +28,7 @@ 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');
|
||||
const clientIp = this.req.get('x-forwarded-for') || this.req.connection.remoteAddress;
|
||||
headers = headers.append('X-Forwarded-For', clientIp);
|
||||
|
||||
options.headers = headers;
|
||||
|
Reference in New Issue
Block a user