Skip to content

Commit c0b9044

Browse files
authored
Revert "Support allowUrls, denyUrls (#2227)"
This reverts commit 7b2e0ad.
1 parent 7b2e0ad commit c0b9044

14 files changed

+10
-418
lines changed

CHANGELOG.md

-14
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,6 @@
44

55
### Features
66

7-
- Support allowUrls and denyUrls for Flutter Web ([#2227](https://github.com/getsentry/sentry-dart/pull/2227))
8-
9-
```dart
10-
await SentryFlutter.init(
11-
(options) {
12-
...
13-
options.allowUrls = ["^https://sentry.com.*\$", "my-custom-domain"];
14-
options.denyUrls = ["^.*ends-with-this\$", "denied-url"];
15-
},
16-
appRunner: () => runApp(MyApp()),
17-
);
18-
```
19-
207
- Session replay Alpha for Android and iOS ([#2208](https://github.com/getsentry/sentry-dart/pull/2208)).
218

229
To try out replay, you can set following options (access is limited to early access orgs on Sentry. If you're interested, [sign up for the waitlist](https://sentry.io/lp/mobile-replay-beta/)):
@@ -44,7 +31,6 @@
4431

4532
- Add `SentryFlutter.nativeCrash()` using MethodChannels for Android and iOS ([#2239](https://github.com/getsentry/sentry-dart/pull/2239))
4633
- This can be used to test if native crash reporting works
47-
4834
- Add `ignoreRoutes` parameter to `SentryNavigatorObserver`. ([#2218](https://github.com/getsentry/sentry-dart/pull/2218))
4935
- This will ignore the Routes and prevent the Route from being pushed to the Sentry server.
5036
- Ignored routes will also create no TTID and TTFD spans.

dart/lib/src/sentry_client.dart

+9-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import 'transport/rate_limiter.dart';
2626
import 'transport/spotlight_http_transport.dart';
2727
import 'transport/task_queue.dart';
2828
import 'utils/isolate_utils.dart';
29-
import 'utils/regex_utils.dart';
3029
import 'utils/stacktrace_utils.dart';
3130
import 'version.dart';
3231

@@ -197,7 +196,7 @@ class SentryClient {
197196
}
198197

199198
var message = event.message!.formatted;
200-
return isMatchingRegexPattern(message, _options.ignoreErrors);
199+
return _isMatchingRegexPattern(message, _options.ignoreErrors);
201200
}
202201

203202
SentryEvent _prepareEvent(SentryEvent event, {dynamic stackTrace}) {
@@ -416,7 +415,7 @@ class SentryClient {
416415
}
417416

418417
var name = transaction.tracer.name;
419-
return isMatchingRegexPattern(name, _options.ignoreTransactions);
418+
return _isMatchingRegexPattern(name, _options.ignoreTransactions);
420419
}
421420

422421
/// Reports the [envelope] to Sentry.io.
@@ -594,4 +593,11 @@ class SentryClient {
594593
SentryId.empty(),
595594
);
596595
}
596+
597+
bool _isMatchingRegexPattern(String value, List<String> regexPattern,
598+
{bool caseSensitive = false}) {
599+
final combinedRegexPattern = regexPattern.join('|');
600+
final regExp = RegExp(combinedRegexPattern, caseSensitive: caseSensitive);
601+
return regExp.hasMatch(value);
602+
}
597603
}

dart/lib/src/sentry_options.dart

-2
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,10 @@ class SentryOptions {
186186

187187
/// The ignoreErrors tells the SDK which errors should be not sent to the sentry server.
188188
/// If an null or an empty list is used, the SDK will send all transactions.
189-
/// To use regex add the `^` and the `$` to the string.
190189
List<String> ignoreErrors = [];
191190

192191
/// The ignoreTransactions tells the SDK which transactions should be not sent to the sentry server.
193192
/// If null or an empty list is used, the SDK will send all transactions.
194-
/// To use regex add the `^` and the `$` to the string.
195193
List<String> ignoreTransactions = [];
196194

197195
final List<String> _inAppExcludes = [];

dart/lib/src/utils/regex_utils.dart

-9
This file was deleted.

dart/test/utils/regex_utils_test.dart

-24
This file was deleted.

flutter/lib/src/event_processor/url_filter/html_url_filter_event_processor.dart

-54
This file was deleted.

flutter/lib/src/event_processor/url_filter/io_url_filter_event_processor.dart

-10
This file was deleted.

flutter/lib/src/event_processor/url_filter/url_filter_event_processor.dart

-9
This file was deleted.

flutter/lib/src/event_processor/url_filter/web_url_filter_event_processor.dart

-56
This file was deleted.

flutter/lib/src/sentry_flutter.dart

-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'event_processor/android_platform_exception_event_processor.dart';
99
import 'event_processor/flutter_enricher_event_processor.dart';
1010
import 'event_processor/flutter_exception_event_processor.dart';
1111
import 'event_processor/platform_exception_event_processor.dart';
12-
import 'event_processor/url_filter/url_filter_event_processor.dart';
1312
import 'event_processor/widget_event_processor.dart';
1413
import 'file_system_transport.dart';
1514
import 'flutter_exception_type_identifier.dart';
@@ -132,7 +131,6 @@ mixin SentryFlutter {
132131

133132
options.addEventProcessor(FlutterEnricherEventProcessor(options));
134133
options.addEventProcessor(WidgetEventProcessor());
135-
options.addEventProcessor(UrlFilterEventProcessor(options));
136134

137135
if (options.platformChecker.platform.isAndroid) {
138136
options.addEventProcessor(

flutter/lib/src/sentry_flutter_options.dart

-15
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,6 @@ class SentryFlutterOptions extends SentryOptions {
146146
/// See https://api.flutter.dev/flutter/foundation/FlutterErrorDetails/silent.html
147147
bool reportSilentFlutterErrors = false;
148148

149-
/// (Web only) Events only occurring on these Urls will be handled and sent to sentry.
150-
/// If an empty list is used, the SDK will send all errors.
151-
/// `allowUrls` uses regex for the matching.
152-
///
153-
/// If used on a platform other than Web, this setting will be ignored.
154-
List<String> allowUrls = [];
155-
156-
/// (Web only) Events occurring on these Urls will be ignored and are not sent to sentry.
157-
/// If an empty list is used, the SDK will send all errors.
158-
/// `denyUrls` uses regex for the matching.
159-
/// In combination with `allowUrls` you can block subdomains of the domains listed in `allowUrls`.
160-
///
161-
/// If used on a platform other than Web, this setting will be ignored.
162-
List<String> denyUrls = [];
163-
164149
/// Enables Out of Memory Tracking for iOS and macCatalyst.
165150
/// See the following link for more information and possible restrictions:
166151
/// https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/

flutter/test/event_processor/url_filter/io_filter_event_processor_test.dart

-39
This file was deleted.

0 commit comments

Comments
 (0)