netutil

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package netutil provides shared HTTP/network normalization helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeHost

func NormalizeHost(raw string) string

NormalizeHost lower-cases and strips ports/trailing dots from host values.

func RemoveHopByHopHeaders

func RemoveHopByHopHeaders(h http.Header)

RemoveHopByHopHeaders strips hop-by-hop headers that must not be proxied.

func RemoveHopByHopHeadersPreserveUpgrade added in v0.5.0

func RemoveHopByHopHeadersPreserveUpgrade(h http.Header)

RemoveHopByHopHeadersPreserveUpgrade strips hop-by-hop headers while preserving websocket upgrade headers when present.

func ShouldPreserveUpgradeHeaders added in v0.5.0

func ShouldPreserveUpgradeHeaders(h http.Header) bool

ShouldPreserveUpgradeHeaders reports whether the header map indicates an HTTP Upgrade handshake that requires preserving Connection/Upgrade headers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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