Versions in this module Expand all Collapse all v1 v1.0.0 Dec 23, 2024 Changes in this version + var ErrUnauthorizedRequest = errors.New("unauthorized request") + type AllowedSource struct + HostPattern string + URLRegex *regexp.Regexp + func NewHostPatternAllowedSource(pattern string) AllowedSource + func NewRegexpAllowedSource(pattern string) (AllowedSource, error) + func (s AllowedSource) Match(u *url.URL) bool + type HTTPLoader struct + Accept string + AllowedSources []AllowedSource + BaseURL *url.URL + BlockLinkLocalNetworks bool + BlockLoopbackNetworks bool + BlockNetworks []*net.IPNet + BlockPrivateNetworks bool + DefaultScheme string + ForwardHeaders []string + MaxAllowedSize int + OverrideHeaders map[string]string + OverrideResponseHeaders []string + Transport http.RoundTripper + UserAgent string + func New(options ...Option) *HTTPLoader + func (h *HTTPLoader) DialControl(network string, address string, conn syscall.RawConn) error + func (h *HTTPLoader) Get(r *http.Request, image string) (*imagor.Blob, error) + type Option func(h *HTTPLoader) + func WithAccept(contentType string) Option + func WithAllowedSourceRegexps(patterns ...string) Option + func WithAllowedSources(hosts ...string) Option + func WithBaseURL(baseURL string) Option + func WithBlockLinkLocalNetworks(enabled bool) Option + func WithBlockLoopbackNetworks(enabled bool) Option + func WithBlockNetworks(networks ...*net.IPNet) Option + func WithBlockPrivateNetworks(enabled bool) Option + func WithDefaultScheme(scheme string) Option + func WithForwardClientHeaders(enabled bool) Option + func WithForwardHeaders(headers ...string) Option + func WithInsecureSkipVerifyTransport(enabled bool) Option + func WithMaxAllowedSize(maxAllowedSize int) Option + func WithOverrideHeader(name, value string) Option + func WithOverrideResponseHeaders(headers ...string) Option + func WithProxyTransport(proxyURLs, hosts string) Option + func WithTransport(transport http.RoundTripper) Option + func WithUserAgent(userAgent string) Option