httputil

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package httputil provides HTTP utility functions for header and cookie manipulation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyCookies

func CopyCookies(src Cookier, dst CookieAdder, filter []string)

func CopyHeaders

func CopyHeaders(src http.Header, dst http.Header, filter []string)

func CopyHeadersRegex

func CopyHeadersRegex(src http.Header, dst http.Header, regex *regexp.Regexp)

Types

type CookieAdder

type CookieAdder interface {
	AddCookie(cookie *http.Cookie)
}

type Cookier

type Cookier interface {
	Cookies() []*http.Cookie
}

type ResponseModifier

type ResponseModifier struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func NewResponseModifier

func NewResponseModifier(rw http.ResponseWriter) *ResponseModifier

func (*ResponseModifier) AddCookie

func (rm *ResponseModifier) AddCookie(cookie *http.Cookie)

func (*ResponseModifier) WriteHeader

func (rm *ResponseModifier) WriteHeader(statusCode int)

WriteHeader writes the status code and any added cookies to the response.

Jump to

Keyboard shortcuts

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