Skip to content

Commit

Permalink
fix: omit cookies when sending request to CDN
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUnderScorer committed Apr 18, 2024
1 parent 49eb9c7 commit c7f3783
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions proxy/handlers/agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ describe('Agent Endpoint', () => {
})
})

test('Req body and headers are the same, expect cookies, which should include only _iidt cookie', async () => {
test('Req body and headers are the same, expect cookies, which should be omitted', async () => {
const req = mockRequestGet('https://fp.domain.com', 'fpjs/agent', {
apiKey: 'ujKG34hUYKLJKJ1F',
version: '5',
Expand Down Expand Up @@ -259,7 +259,7 @@ describe('Agent Endpoint', () => {

expect(options.headers).toEqual({
...req.headers,
cookie: '_iidt=GlMQaHMfzYvomxCuA7Uymy7ArmjH04jPkT+enN7j/Xk8tJG+UYcQV+Qw60Ry4huw9bmDoO/smyjQp5vLCuSf8t4Jow==',
cookie: undefined,
})
})

Expand Down
2 changes: 2 additions & 0 deletions proxy/handlers/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ export async function downloadAgent({ httpRequest, logger, path }: DownloadAgent

const headers = filterRequestHeaders(httpRequest.headers)

delete headers['cookie']

return new Promise<HttpResponseSimple>((resolve) => {
const data: any[] = []

Expand Down

0 comments on commit c7f3783

Please sign in to comment.