Skip to content

ezhttp: support for not following redirects #25

@joonas-fi

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
		},
	})
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions