Pass the authentication code when fetching timeline and CPU profile data

See https://github.com/flutter/flutter/issues/31565

Change-Id: I0e84df9539a8b25776b510148a7583294cf90c1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100521
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
diff --git a/runtime/observatory/web/timeline.js b/runtime/observatory/web/timeline.js
index 9e92ad4..16d8592 100644
--- a/runtime/observatory/web/timeline.js
+++ b/runtime/observatory/web/timeline.js
@@ -622,6 +622,7 @@
                      parser.hostname +
                      ':' +
                      parser.port +
+                     parser.pathname.replace(/\/ws$/, "") +
                      '/_getCpuProfileTimeline?tags=None&isolateId=' +
                      isolateId +
                      '&timeOriginMicros=' + timeOrigin +
@@ -646,6 +647,7 @@
                    parser.hostname +
                    ':' +
                    parser.port +
+                   parser.pathname.replace(/\/ws$/, "") +
                    '/_getVMTimeline';
   fetchUri(requestUri, function(event) {
     // Grab the response.