Skip to content

Commit 6f4bd7e

Browse files
Apply suggestions from code review
Co-authored-by: Liza Mock <[email protected]>
1 parent 1f273da commit 6f4bd7e

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

docs/platforms/react-native/migration/v5-to-v6.mdx

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -234,27 +234,20 @@ Sentry.init({
234234
});
235235
```
236236
237-
### Updated behaviour of `tracePropagationTargets` in React Native
237+
### Updated Behavior of `tracePropagationTargets` in React Native
238238
239-
We updated the behaviour of the SDKs when no `tracePropagationTargets` option was defined. As a reminder, you can
240-
provide a list of strings or RegExes that will be matched against URLs to tell the SDK, to which outgoing requests
241-
tracing HTTP headers should be attached to. These tracing headers are used for distributed tracing.
239+
We updated the behavior of the SDKs when no `tracePropagationTargets` option was defined. As a reminder, you can provide a list of strings or RegExes that will be matched against URLs to let the SDK know which outgoing requests tracing HTTP headers should be attached to. These tracing headers are used for distributed tracing.
242240
243-
Previously, on the browser and in React native, when `tracePropagationTargets` were not defined, they defaulted to the following:
244-
`['localhost', /^\/(?!\/)/]`. This meant that all request targets to that had "localhost" in the URL, or started with a
245-
`/` were equipped with tracing headers. This default was chosen to prevent CORS errors in your browser applications.
246-
However, this default had a few flaws.
241+
Previously, on the browser and in React native, when `tracePropagationTargets` weren't defined, they defaulted to the following:
242+
`['localhost', /^\/(?!\/)/]`. This meant that all request targets that had "localhost" in the URL, or started with a
243+
`/` were equipped with tracing headers. This default was chosen to prevent CORS errors in your browser applications. However, this default had a few flaws.
247244
248-
Going forward, when the `tracePropagationTargets` option is not set,
245+
Going forward, when the `tracePropagationTargets` option isn't set:
249246
- tracing headers will be attached to all outgoing requests in React Native
250-
- and to all outgoing on the same origin on the Browser (including WebViews).
247+
- tracing headers will also be attached to all outgoing requests on the same origin as the Browser (including WebViews)
251248
252249
For example, if you're on `https://example.com/` and you send a request to
253-
`https://example.com/api`, the request will be traced (ie. will have trace headers attached). Requests to
254-
`https://api.example.com/` will not, because it is on a different origin. The same goes for all applications running on
255-
`localhost`.
256-
257-
When you provide a `tracePropagationTargets` option, all of the entries you defined will now be matched
258-
against the full URL of the outgoing request. Previously, it was only matched against what you called request APIs with.
259-
For example, if you made a request like `fetch("/api/posts")`, the provided `tracePropagationTargets` were only compared
260-
against `"/api/posts"`.
250+
`https://example.com/api`, the request will be traced (in other words, it will have trace headers attached). Requests sent to `https://api.example.com/` on the other hand, will not, because they're on a different origin. The same goes for all applications running on `localhost`.
251+
252+
When you provide a `tracePropagationTargets` option, all of the entries you define will now be matched
253+
against the full URL of the outgoing request. Previously, it was only matched against what you called request APIs with. For example, if you made a request like `fetch("/api/posts")`, the provided `tracePropagationTargets` were only compared against `"/api/posts"`.

0 commit comments

Comments
 (0)