chore(fetcher): always set same URL host as referer
This commit is contained in:
parent
c5112124f5
commit
281cba8da1
2 changed files with 3 additions and 0 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue