Skip to content

Commit d5e1123

Browse files
committed
use isweb directly
1 parent b44278c commit d5e1123

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

dart/lib/src/transport/http_transport.dart

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import 'dart:convert';
44
import 'package:http/http.dart';
55

66
import '../noop_client.dart';
7-
import '../platform_checker.dart';
87
import '../protocol.dart';
98
import '../sentry_options.dart';
109
import 'noop_encode.dart' if (dart.library.io) 'encode.dart';
@@ -30,8 +29,8 @@ class HttpTransport implements Transport {
3029

3130
HttpTransport._(this._options)
3231
: _dsn = Dsn.parse(_options.dsn!),
33-
_headers =
34-
_buildHeaders(_options.platformChecker, _options.sdk.identifier) {
32+
_headers = _buildHeaders(
33+
_options.platformChecker.isWeb, _options.sdk.identifier) {
3534
_credentialBuilder = _CredentialBuilder(
3635
_dsn,
3736
_options.sdk.identifier,
@@ -139,12 +138,11 @@ class _CredentialBuilder {
139138
}
140139
}
141140

142-
Map<String, String> _buildHeaders(
143-
PlatformChecker checker, String sdkIdentifier) {
141+
Map<String, String> _buildHeaders(bool isWeb, String sdkIdentifier) {
144142
final headers = {'Content-Type': 'application/json'};
145143
// NOTE(lejard_h) overriding user agent on VM and Flutter not sure why
146144
// for web it use browser user agent
147-
if (!checker.isWeb) {
145+
if (!isWeb) {
148146
headers['User-Agent'] = sdkIdentifier;
149147
}
150148
return headers;

0 commit comments

Comments
 (0)