about summary refs log tree commit diff
path: root/editors/code
diff options
context:
space:
mode:
authorwxb1ank <wxblank@gmail.com>2021-06-14 23:29:38 -0400
committerwxb1ank <wxblank@gmail.com>2021-06-14 23:29:38 -0400
commit7a8a72c38f5626aea6c8f3c2dacbb23ed166901e (patch)
tree7ce7861ba441ed258c5d696a06769a75490942dc /editors/code
parent447d849c9ecb3d0f7783a56db429ccc526d0d8dc (diff)
downloadrust-7a8a72c38f5626aea6c8f3c2dacbb23ed166901e.tar.gz
rust-7a8a72c38f5626aea6c8f3c2dacbb23ed166901e.zip
Use `Uri.toString()` for URLs
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/src/net.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/editors/code/src/net.ts b/editors/code/src/net.ts
index 747c02db91a..5c48c74e8d5 100644
--- a/editors/code/src/net.ts
+++ b/editors/code/src/net.ts
@@ -127,17 +127,19 @@ async function downloadFile(
     httpProxy: string | null | undefined,
     onProgress: (readBytes: number, totalBytes: number) => void
 ): Promise<void> {
+    const urlString = url.toString();
+
     const res = await (() => {
         if (httpProxy) {
-            log.debug(`Downloading ${url.path} via proxy: ${httpProxy}`);
-            return fetch(url.path, { agent: new HttpsProxyAgent(httpProxy) });
+            log.debug(`Downloading ${urlString} via proxy: ${httpProxy}`);
+            return fetch(urlString, { agent: new HttpsProxyAgent(httpProxy) });
         }
 
-        return fetch(url.path);
+        return fetch(urlString);
     })();
 
     if (!res.ok) {
-        log.error("Error", res.status, "while downloading file from", url.path);
+        log.error("Error", res.status, "while downloading file from", urlString);
         log.error({ body: await res.text(), headers: res.headers });
 
         throw new Error(`Got response ${res.status} when trying to download a file.`);
@@ -146,7 +148,7 @@ async function downloadFile(
     const totalBytes = Number(res.headers.get('content-length'));
     assert(!Number.isNaN(totalBytes), "Sanity check of content-length protocol");
 
-    log.debug("Downloading file of", totalBytes, "bytes size from", url.path, "to", destFilePath.path);
+    log.debug("Downloading file of", totalBytes, "bytes size from", urlString, "to", destFilePath.path);
 
     let readBytes = 0;
     res.body.on("data", (chunk: Buffer) => {