Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

tokens

Manav Rathi26d8ecda08aa
diff --git a/web/packages/next/http.ts b/web/packages/next/http.ts
index 0eacdaad77..dde5906aef 100644
--- a/web/packages/next/http.ts
+++ b/web/packages/next/http.ts
@@ -28,9 +28,16 @@ export class HTTPError extends Error {
res: Response;
constructor(res: Response) {
+ // Trim off any query parameters from the URL before logging, it may
+ // have tokens.
+ //
// Nb: res.url is URL obtained after any redirects, and thus is not
// necessarily the same as the request's URL.
- super(`Fetch failed: ${res.url}: HTTP ${res.status} ${res.statusText}`);
+ const url = new URL(res.url);
+ url.search = "";
+ super(
+ `Fetch failed: ${url.href}: HTTP ${res.status} ${res.statusText}`,
+ );
// Cargo culted from
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#custom_error_types