-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(remix): Use domains to prevent scope bleed (#5570)
This patch wraps both the express and built-in request handlers with domains, preventing scope bleeding from happening. It also updates our express request handler to match that of the `withSentry` handler from NextJS. In a follow-up patch, we'll consolidate the implementations of both these handlers. To test this, we've added an integration test. Co-authored-by: Onur Temizkan <[email protected]>
- Loading branch information
1 parent
4e36d26
commit bdd7fde
Showing
4 changed files
with
161 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/remix/test/integration/app/routes/scope-bleed/$id.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { json, LoaderFunction } from '@remix-run/node'; | ||
|
||
import * as Sentry from '@sentry/remix'; | ||
|
||
export const loader: LoaderFunction = async ({ params: { id } }) => { | ||
const timeTil = parseInt(id || '', 10) * 1000; | ||
await new Promise(resolve => setTimeout(resolve, 3000 - timeTil)); | ||
Sentry.setTag(`tag${id}`, id); | ||
return json({ test: 'test' }); | ||
}; | ||
|
||
export default function ScopeBleed() { | ||
return ( | ||
<div> | ||
<h1>Hello</h1> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters