httpx

package
v0.3.3 Latest Latest
Warning

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

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

Documentation

Overview

Package httpx is the shared HTTP helper for collectors. Every request goes through the scan's guarded client (core.HTTPClient), and responses are memoized per scan so checks that read the same page share one request.

Index

Constants

View Source
const MaxBody = 1 << 20

MaxBody caps how much of a response body is read.

Variables

This section is empty.

Functions

func Asset

func Asset(t core.Target, u *url.URL) core.Asset

Asset describes a URL on the target as a finding asset.

func Resolve

func Resolve(t core.Target, path string) (*url.URL, error)

Resolve joins a path onto the target's base URL.

Types

type Page

type Page struct {
	URL      *url.URL // final URL after redirects
	Status   int
	Header   http.Header
	Cookies  []*http.Cookie
	Body     []byte
	Request  string // evidence: request line + headers
	Response string // evidence: status, headers, truncated body
}

Page is a fetched response.

func Do

func Do(ctx context.Context, method, rawURL string, header http.Header) (*Page, error)

Do sends one request through the guarded client without memoizing.

func Get

func Get(ctx context.Context, rawURL string) (*Page, error)

Get fetches rawURL once per scan.

Jump to

Keyboard shortcuts

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