feat: send also X-Real-IP next to X-Forwarded-For
This commit is contained in:
parent
23d123851b
commit
b7a8fc4e76
2 changed files with 8 additions and 1 deletions
|
|
@ -35,7 +35,13 @@ describe('fetch', () => {
|
|||
expect(responseText).toBe('some text');
|
||||
expect(mockedFetch).toHaveBeenCalledWith(
|
||||
'https://some-url.test',
|
||||
{ headers: { 'User-Agent': expect.not.stringMatching(/jest/), 'X-Forwarded-For': '127.0.0.1' } },
|
||||
{
|
||||
headers: {
|
||||
'User-Agent': expect.not.stringMatching(/jest/),
|
||||
'X-Forwarded-For': '127.0.0.1',
|
||||
'X-Real-IP': '127.0.0.1',
|
||||
},
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ export class Fetcher {
|
|||
...opts?.headers,
|
||||
'User-Agent': this.createUserAgentForIp(ctx.ip),
|
||||
'X-Forwarded-For': ctx.ip,
|
||||
'X-Real-IP': ctx.ip,
|
||||
},
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue