chore(fetcher): set more headers to mimick browser requests
This commit is contained in:
parent
f2a7da21e0
commit
07ddaab7fb
2 changed files with 7 additions and 1 deletions
|
|
@ -26,10 +26,13 @@ describe('fetch', () => {
|
|||
'https://some-url.test/',
|
||||
{
|
||||
headers: {
|
||||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
||||
'Accept-Language': 'en',
|
||||
'Forwarded': 'for=127.0.0.1',
|
||||
'Origin': 'https://some-url.test',
|
||||
'User-Agent': expect.not.stringMatching(/jest/),
|
||||
'Priority': 'u=0',
|
||||
'Referer': 'https://some-url.test',
|
||||
'User-Agent': expect.not.stringMatching(/jest/),
|
||||
'X-Forwarded-For': '127.0.0.1',
|
||||
'X-Forwarded-Proto': 'https',
|
||||
'X-Real-IP': '127.0.0.1',
|
||||
|
|
|
|||
|
|
@ -43,8 +43,11 @@ export class Fetcher {
|
|||
timeout: 15000,
|
||||
...config,
|
||||
headers: {
|
||||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
||||
'Accept-Language': 'en',
|
||||
'Forwarded': `for=${ctx.ip}`,
|
||||
'Origin': `${origin}`,
|
||||
'Priority': 'u=0',
|
||||
'Referer': `${referer}`,
|
||||
'User-Agent': this.createUserAgentForIp(ctx.ip),
|
||||
'X-Forwarded-For': ctx.ip,
|
||||
|
|
|
|||
Loading…
Reference in a new issue