@@ -43,33 +43,7 @@ class MockTransport implements Transport {
43
43
44
44
final envelopeItem = utf8.decode (envelopeItemData);
45
45
final envelopeItemJson = jsonDecode (envelopeItem.split ('\n ' ).last);
46
- final envelopeMap = envelopeItemJson as Map <String , dynamic >;
47
- final requestJson = envelopeMap['request' ] as Map <String , dynamic >? ;
48
-
49
- // TODO the following code should really be part of fromJson() that handle those keys.
50
- // JSON being Map<String, dynamic> is nothing out of ordinary.
51
- // See [SentryResponse.fromJson()] as an example.
52
-
53
- // '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, String>'
54
- final headersMap = requestJson? ['headers' ] as Map <String , dynamic >? ;
55
- final newHeadersMap = < String , String > {};
56
- if (headersMap != null ) {
57
- for (final entry in headersMap.entries) {
58
- newHeadersMap[entry.key] = entry.value as String ;
59
- }
60
- envelopeMap['request' ]['headers' ] = newHeadersMap;
61
- }
62
-
63
- final otherMap = requestJson? ['other' ] as Map <String , dynamic >? ;
64
- final newOtherMap = < String , String > {};
65
- if (otherMap != null ) {
66
- for (final entry in otherMap.entries) {
67
- newOtherMap[entry.key] = entry.value as String ;
68
- }
69
- envelopeMap['request' ]['other' ] = newOtherMap;
70
- }
71
-
72
- return SentryEvent .fromJson (envelopeMap);
46
+ return SentryEvent .fromJson (envelopeItemJson);
73
47
}
74
48
75
49
void reset () {
0 commit comments