Skip to main content

build_http_client

Function build_http_client 

Source
pub fn build_http_client(
    enforce_external_addresses: bool,
) -> Result<Client, Error>
Expand description

Build a reqwest Client for fetching COPY FROM URLs. This uses mz_ore::netio::resolve_address for DNS resolution.

Redirects are disabled: the custom DNS resolver re-validates hostnames on every hop, but reqwest skips DNS for IP-literal targets, so a redirect to http://127.0.0.1/ would bypass the SSRF check. Refusing to follow redirects closes that hole.