MCPcopy Create free account
hub / github.com/docker/docker-agent / defaultHTTPPostClient

Function defaultHTTPPostClient

pkg/hooks/builtins/http_post.go:33–35  ·  view source on GitHub ↗

defaultHTTPPostClient is the production HTTP client used by httpPost. It refuses connections to non-public IPs at dial time (defeating DNS rebinding to loopback / RFC1918 / link-local incl. cloud metadata at 169.254.169.254) and bounds redirects at 10 hops.

()

Source from the content-addressed store, hash-verified

31// rebinding to loopback / RFC1918 / link-local incl. cloud metadata at
32// 169.254.169.254) and bounds redirects at 10 hops.
33func defaultHTTPPostClient() httpDoer {
34 return httpclient.NewSafeClient(30*time.Second, false)
35}
36
37// newHTTPPost returns the http_post builtin bound to client. POSTs args[1]
38// to args[0] with Content-Type: application/json.

Callers 1

RegisterFunction · 0.85

Calls 1

NewSafeClientFunction · 0.92

Tested by

no test coverage detected