INNER CODE UNIT · Python

_headers

deeplethe/forkd · sdk/mcp/sandstorm_mcp/server.py:64

def _headers(sandbox_token: str | None = None) -> dict[str, str]:
    h = {"Content-Type": "application/json"}
    if SANDSTORM_TOKEN:
        h["Authorization"] = f"Bearer {SANDSTORM_TOKEN}"
    if sandbox_token is not None:
        h["x-sandstorm-sandbox-token"] = sandbox_token
    return h


def _client(sandbox_token: str | None = None, timeout: float = HTTP_TIMEOUT) -> httpx.Client:
    return httpx.Client(
        base_url=SANDSTORM_URL,
        headers=_headers(sandbox_token),
        timeout=max(timeout, HTTP_TIMEOUT),
        verify=SSL_CONTEXT if SSL_CONTEXT is not None else True,
    )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…