garrytan/gstack · error

Download failed: HTTP ${status} ${response.statusText()}

Error message

Download failed: HTTP ${status} ${response.statusText()}

What it means

Error "Download failed: HTTP ${status} ${response.statusText()}" thrown in garrytan/gstack.

Source

Thrown at browse/src/write-commands.ts:1278

        }
        if (buffer.length > 200 * 1024 * 1024) {
          throw new Error('File too large (>200MB).');
        }
      } else {
        // Strategy 1: Direct URL via page.request.fetch().
        // Gate the URL through the same validator `goto` uses. Without
        // this check, download + scrape bypass the navigation
        // blocklist and a caller with write scope can read
        // http://169.254.169.254/latest/meta-data/ (AWS IMDSv1), the
        // GCP/Azure metadata equivalents, or any internal IPv4/IPv6
        // the server happens to route to. The response body is then
        // returned to the caller (base64) or written to disk where
        // GET /file serves it back.
        await validateNavigationUrl(url);
        const response = await page.request.fetch(url, { timeout: 30000 });
        const status = response.status();
        if (status >= 400) {
          throw new Error(`Download failed: HTTP ${status} ${response.statusText()}`);
        }
        contentType = response.headers()['content-type'] || 'application/octet-stream';
        buffer = Buffer.from(await response.body());
        if (buffer.length > 200 * 1024 * 1024) {
          throw new Error('File too large (>200MB).');
        }
      }

      // --base64 mode: return inline
      if (isBase64) {
        if (buffer.length > 10 * 1024 * 1024) {
          throw new Error('File too large for --base64 (>10MB). Use disk download + GET /file instead.');
        }
        const mimeType = contentType.split(';')[0].trim();
        return `data:${mimeType};base64,${buffer.toString('base64')}`;
      }

      // Write to disk

View on GitHub (pinned to 94993f7401)

When it happens

Trigger: Thrown at browse/src/write-commands.ts:1278 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of garrytan/gstack@94993f7401 (2026-08-12). Data as JSON: /api/errors/915d8155f489847f. Report an issue: GitHub.