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 {
8787 // The requestedUri contains the hostname and port which guarantees
8888 // uniqueness.
8989 final requestedUri = request.requestedUri;
90- final appId = base64.encode (
91- md5.convert (utf8.encode ('$requestedUri ' )).bytes,
92- );
90+ final appId = _base64Md5 ('$requestedUri ' );
9391 var scheme = request.requestedUri.scheme;
9492 if (! globalToolConfiguration.debugSettings.useSseForInjectedClient) {
9593 // Switch http->ws and https->wss.
@@ -128,7 +126,7 @@ class DwdsInjector {
128126 'Injected debugging metadata for '
129127 'entrypoint at $requestedUri ' ,
130128 );
131- etag = base64. encode (md5. convert ( body.codeUnits).bytes );
129+ etag = _base64Md5 ( body);
132130 newHeaders[HttpHeaders .etagHeader] = etag;
133131 }
134132 if (ifNoneMatch == etag) {
@@ -237,3 +235,10 @@ Future<String> _injectedClientSnippet(
237235
238236 return injectedBody;
239237}
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