diff --git a/src/utils/Fetcher.test.ts b/src/utils/Fetcher.test.ts index a0001a9..f56642c 100644 --- a/src/utils/Fetcher.test.ts +++ b/src/utils/Fetcher.test.ts @@ -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', + }, + }, ); }); }); diff --git a/src/utils/Fetcher.ts b/src/utils/Fetcher.ts index b95d838..74042f4 100644 --- a/src/utils/Fetcher.ts +++ b/src/utils/Fetcher.ts @@ -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, }, }, );