samehost

package
v0.29.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package samehost stops a request following a redirect to another host.

Index

Constants

This section is empty.

Variables

View Source
var ErrCrossHostRedirect = errors.New("refused a redirect to another host")

ErrCrossHostRedirect reports a redirect that left the host it was sent to.

View Source
var ErrDowngradeRedirect = errors.New("refused a redirect from https to http")

ErrDowngradeRedirect reports a redirect from https to plain http.

Functions

func Redirects

func Redirects(req *http.Request, via []*http.Request) error

Redirects is an http.Client CheckRedirect for a client that carries a credential in its own header. net/http strips Authorization and Cookie across hosts, and copies every other header, including to plain http on the same host.

Types

This section is empty.

Directories

Path Synopsis
Package samehosttest stands up a server that redirects to another host, for proving a client's redirect policy is wired in.
Package samehosttest stands up a server that redirects to another host, for proving a client's redirect policy is wired in.

Jump to

Keyboard shortcuts

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