Why Nostr? What is Njump?
2025-02-21 13:55:27

Nicolas Martyanoff on Nostr: The standard Go HTTP client follows redirections by default. You can disable it with ...

The standard Go HTTP client follows redirections by default. You can disable it with a custom CheckRedirect function in the client. But you cannot disable it for a single request, it's all or nothing. Terrible design.

A workaround is to use Client.Transport.RoundTrip() which will bypass the whole redirection logic of Client.Do(), but if you do so you will also miss features such as request cancellation.
Author Public Key
npub1dkg70vzk4vvfsc5cup9gkfu2tcrs5unysl7npfvegf78nkuswr5skh54dt