redirect

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package redirect 收放客户端的重定向策略。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SameOrigin

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

SameOrigin 只允许同源跳转,并拒绝协议降级。

Go 的默认策略会跟着 3xx 走,并且只为 Authorization / Cookie / Proxy-Authorization 这几个头做跨域剥离:自定义的 x-api-key、api-key、x-goog-api-key 会照发,307/308 还会把方法与请求正文一并带给新主机。对本仓库这些客户端来说,正文可能是服务配置 或对话内容,头里可能是密钥——一跳就送出去了。

Types

This section is empty.

Jump to

Keyboard shortcuts

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