-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add payload host denylist #1282
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
import { NetworkRecordOptions } from '../../../../types' | ||
import { isHostOnDenyList } from '../../../../extensions/replay/external/denylist' | ||
|
||
describe('network host denylist', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made me sad "we" weren't testing any network recorder code
Size Change: +4.67 kB (+0.41%) Total Size: 1.15 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
giving us a place we can start moving code out of the entrypoint file
as we do we should add a lint rule restricting what can import it
const defaultNotDenied = { hostname, isHostDenied: false } | ||
|
||
if (!options.payloadHostDenyList?.length || !hostname?.trim().length) { | ||
return defaultNotDenied | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fail open
} | ||
|
||
for (const deny of options.payloadHostDenyList) { | ||
if (hostname.endsWith(deny)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
went with endsWith
over regex or something...
so that we can say e.g. .lr-ingest.io
and not get any of their payloads
We've seen replay message be rejected for being too large
And on inspection they contain many megabytes of replay data for other vendors
There's no point capturing those payloads 🙈