zed-industries/zed · error · std::io::Error

BlockedHttpClient disallowed request

Error message

BlockedHttpClient disallowed request

What it means

A request was attempted through BlockedHttpClient, an HttpClient implementation that deliberately denies all network access. It is installed in contexts (e.g. sandboxed or offline agents) where outbound HTTP is forbidden by policy.

Source

Thrown at crates/http_client/src/http_client.rs:393

    ENV_VARS.iter().find_map(|var| std::env::var(var).ok())
}

pub struct BlockedHttpClient;

impl BlockedHttpClient {
    pub fn new() -> Self {
        BlockedHttpClient
    }
}

impl HttpClient for BlockedHttpClient {
    fn send(
        &self,
        _req: Request<AsyncBody>,
    ) -> BoxFuture<'static, anyhow::Result<Response<AsyncBody>>> {
        Box::pin(async {
            Err(std::io::Error::new(
                std::io::ErrorKind::PermissionDenied,
                "BlockedHttpClient disallowed request",
            )
            .into())
        })
    }

    fn user_agent(&self) -> Option<&HeaderValue> {
        None
    }

    fn proxy(&self) -> Option<&Url> {
        None
    }

    #[cfg(feature = "test-support")]
    fn as_fake(&self) -> &FakeHttpClient {
        panic!("called as_fake on {}", type_name::<Self>())

View on GitHub (pinned to f4178619ac)

Solutions

  1. Use a real HTTP client in contexts where network access is permitted
  2. Respect the block: perform the task without network requests, or surface 'network disabled' to the user
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/http_client/src/http_client.rs:393 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/613841bbd79a7a2c. Report an issue: GitHub.