Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultTransport ¶
NewDefaultTransport constructs an http.Transport with settings that should match http.DefaultTransport. Use this when you want to customize your transport options without modifying the global http.DefaultTransport.
This is copied from the golang source source:
Types ¶
type Client ¶
Client is a wrapper around http.Client that adds some convenience methods for making requests and handling responses.
func NewClientWithTimeout ¶
NewClientWithTimeout returns a new Client with the specified timeout.
type HSTS ¶
type HSTS struct { // MaxAge sets the duration that the HSTS is valid for. MaxAge time.Duration // HostOverride provides a host to the redirection URL in the case that the system is behind a load balancer // which doesn't provide the X-Forwarded-Host HTTP header (e.g. an Amazon ELB). HostOverride string // Decides whether to accept the X-Forwarded-Proto header as proof of SSL. AcceptXForwardedProtoHeader bool // SendPreloadDirective sets whether the preload directive should be set. The directive allows browsers to // confirm that the site should be added to a preload list. (see https://hstspreload.appspot.com/) SendPreloadDirective bool // contains filtered or unexported fields }
Add HSTS header to response See: https://github.com/chef/automate/issues/5698
func HSTSHandler ¶
type HTTPClient ¶
type HTTPClient interface { MakeRequest(requestMethod, url string, body interface{}) (*http.Response, []byte, error) MakeRequestWithHeaders(requestMethod, url string, body interface{}, headerkey string, headerValue string) (*http.Response, []byte, error) }
HTTPClient interface represents an HTTP client.
type MockHTTPClient ¶
type MockHTTPClient struct { MakeRequestFunc func(requestMethod, url string, body interface{}) (*http.Response, []byte, error) MakeRequestWithHeadersfunc func(requestMethod, url string, body interface{}, headerkey string, headerValue string) (*http.Response, []byte, error) }
MockHTTPClient is a mock implementation of HTTPClient.
func (*MockHTTPClient) MakeRequest ¶
func (*MockHTTPClient) MakeRequestWithHeaders ¶
Click to show internal directories.
Click to hide internal directories.