Cotal TypeScript packages
    Preparing search index...

    Function pinnedFetch

    • One hop, no downgrade, no redirect-following: a fetch that CANNOT be walked off HTTPS.

      fetch follows redirects by default and will happily follow https:// → http://, so a 302 from anyone on the path turns a pinned, encrypted fetch into a plaintext one — and the document being fetched IS the trust being adopted. redirect: "manual" stops the hop here; a redirect is then reported as the refusal it is, rather than silently followed.

      Loopback http:// stays usable for tests and for an exchange on this machine (nothing leaves the box), which is also what keeps the suites honest without a TLS fixture. Everything else must be https:.

      Parameters

      • target: string
      • what: string

      Returns Promise<Response>