diff --git a/src/utils/Fetcher.test.ts b/src/utils/Fetcher.test.ts index b6797a9..4388c4c 100644 --- a/src/utils/Fetcher.test.ts +++ b/src/utils/Fetcher.test.ts @@ -27,6 +27,7 @@ describe('fetch', () => { headers: { 'User-Agent': expect.not.stringMatching(/jest/), 'Forwarded': 'for=127.0.0.1', + 'Referer': 'https://some-url.test', 'X-Forwarded-For': '127.0.0.1', 'X-Forwarded-Proto': 'https', 'X-Real-IP': '127.0.0.1', @@ -54,6 +55,7 @@ describe('fetch', () => { headers: { 'User-Agent': expect.not.stringMatching(/jest/), 'Forwarded': 'for=127.0.0.1', + 'Referer': 'https://some-url.test', 'X-Forwarded-For': '127.0.0.1', 'X-Forwarded-Proto': 'https', 'X-Real-IP': '127.0.0.1', diff --git a/src/utils/Fetcher.ts b/src/utils/Fetcher.ts index ca81fb5..9ef1d82 100644 --- a/src/utils/Fetcher.ts +++ b/src/utils/Fetcher.ts @@ -40,6 +40,7 @@ export class Fetcher { ...config?.headers, 'User-Agent': this.createUserAgentForIp(ctx.ip), 'Forwarded': `for=${ctx.ip}`, + 'Referer': `${url.protocol}//${url.host}`, 'X-Forwarded-For': ctx.ip, 'X-Forwarded-Proto': url.protocol.slice(0, -1), 'X-Real-IP': ctx.ip,