Skip to content

ezhttp: support for not following redirects #25

Description

@joonas-fi
var (
        // can't patch existing HTTP client because we could end up modifying `http.DefaultClient`
        // https://stackoverflow.com/a/38150816
	noFollowRedirects = ezhttp.Client(&http.Client{
		CheckRedirect: func(_ *http.Request, _ []*http.Request) error {
			// no error - just don't follow redirects
			return http.ErrUseLastResponse
		},
	})
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions