credentialhttp

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package credentialhttp provides the module-internal HTTP redirect policy for clients that attach credentials or signed request bodies.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCrossOriginRedirect reports a redirect that would move a credentialed
	// request to a different origin.
	ErrCrossOriginRedirect = errors.New("credential HTTP client rejected a cross-origin redirect")
	// ErrRedirectLimit reports a redirect chain beyond the bounded policy.
	ErrRedirectLimit = errors.New("credential HTTP client exceeded its redirect limit")
)

Functions

func CheckRedirect

func CheckRedirect(request *http.Request, via []*http.Request) error

CheckRedirect is the shared redirect callback for credential-bearing HTTP clients in this module.

func NewClient

func NewClient(timeout time.Duration) *http.Client

NewClient returns an HTTP client that follows only bounded same-origin redirects. It prevents custom authentication headers and signed request bodies from being replayed to a different scheme, host, or effective port.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL