httpx

package
v1.8.0 Latest Latest
Warning

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

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

Documentation

Overview

Package httpx centralizes the CLI's outbound HTTP security policy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIBaseURL

func APIBaseURL(site string) string

APIBaseURL adds Normatik's fixed API context path to a canonical site URL.

func CanonicalSiteURL

func CanonicalSiteURL(raw string) string

CanonicalSiteURL normalizes the user-facing environment URL. A legacy trailing /api context path is stripped because transports own that prefix.

func NewClient

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

NewClient creates an HTTP client that follows redirects only within the exact original origin (scheme, hostname and effective port). The transport is DefaultTransport wrapped so every request carries the process User-Agent.

func SetUserAgent added in v1.7.0

func SetUserAgent(value string)

SetUserAgent replaces the User-Agent sent on later requests. NewClient reads it per request, so a client built before this call still sends the new value.

func UserAgent added in v1.7.0

func UserAgent() string

UserAgent returns the User-Agent the next request will send.

func ValidateBaseURL

func ValidateBaseURL(raw string) error

ValidateBaseURL allows HTTPS everywhere and plaintext HTTP only for literal loopback targets when the development opt-in is exactly "1".

Types

This section is empty.

Jump to

Keyboard shortcuts

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