File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -87,9 +87,7 @@ class DwdsInjector {
87
87
// The requestedUri contains the hostname and port which guarantees
88
88
// uniqueness.
89
89
final requestedUri = request.requestedUri;
90
- final appId = base64.encode (
91
- md5.convert (utf8.encode ('$requestedUri ' )).bytes,
92
- );
90
+ final appId = _base64Md5 ('$requestedUri ' );
93
91
var scheme = request.requestedUri.scheme;
94
92
if (! globalToolConfiguration.debugSettings.useSseForInjectedClient) {
95
93
// Switch http->ws and https->wss.
@@ -128,7 +126,7 @@ class DwdsInjector {
128
126
'Injected debugging metadata for '
129
127
'entrypoint at $requestedUri ' ,
130
128
);
131
- etag = base64. encode (md5. convert ( body.codeUnits).bytes );
129
+ etag = _base64Md5 ( body);
132
130
newHeaders[HttpHeaders .etagHeader] = etag;
133
131
}
134
132
if (ifNoneMatch == etag) {
@@ -237,3 +235,10 @@ Future<String> _injectedClientSnippet(
237
235
238
236
return injectedBody;
239
237
}
238
+
239
+ final _utf8FusedConverter = utf8.encoder.fuse (md5);
240
+
241
+ String _base64Md5 (String input) {
242
+ final bytes = _utf8FusedConverter.convert (input).bytes;
243
+ return base64.encode (bytes);
244
+ }
You can’t perform that action at this time.
0 commit comments