Skip to content

Commit

Permalink
Add test case to ensure we don't log 'user-agent: Zapier'
Browse files Browse the repository at this point in the history
  • Loading branch information
eliangcs committed Oct 30, 2024
1 parent 5a85725 commit 72b43ad
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/core/test/tools/fetch-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,20 @@ describe('wrap fetch with logger', () => {
assert.equal(obj.id, i);
}
});

it('should not log requests with Zapier user-agent', async () => {
const url = `${HTTPBIN_URL}/get?made_by=z.request`;
const response = await newFetch(url, {
headers: {
'user-agent': 'Zapier',
},
});
const data = await response.json();

assert.equal(response.status, 200);
assert.equal(data.args.made_by, 'z.request');

// No logs should be created
assert.equal(logs.length, 0);
});
});

0 comments on commit 72b43ad

Please sign in to comment.