package
0.0.0-20221027220206-53a1486f4205
Repository: https://github.com/google/webpackager.git
Documentation: pkg.go.dev
# Packages
Package fetchtest provides FetchClient implementations for use in testing.
# Functions
CopyParentHeaders copies the header fields of the provided keys from the parent request.
NeverRedirect instructs http.Client to stop handling the redirect and just return the last response instead, when set to the CheckRedirect field.
SetCustomHeaders populates the provided HTTP header fields to the request.
SetReferer sets the Referer HTTP header with the parent request URL.
WithSelector wraps client to issue a fetch only if the request URL matches selector.
# Variables
DefaultFetchClient is a drop-in FetchClient to fetch content via HTTP in a usual manner.
DefaultRequestTweaker is a RequestTweaker used by default.
ErrURLMismatch is returned by WithSelector clients when the request URL does not match their selector.
# Interfaces
FetchClient retrieves contents from the server or other data source.
RequestTweaker mutates an http.Request to set the refer(r)er, add custom HTTP headers, and so on.
# Type aliases
RequestTweakerSequence consists of a series of RequestTweakers.