MCPcopy Create free account
hub / github.com/cli/cli / serverHostname

Function serverHostname

api/http_client_test.go:425–430  ·  view source on GitHub ↗

serverHostname returns the hostname of a test server URL, so config can be keyed by host, as production config is, rather than host:port.

(t *testing.T, rawURL string)

Source from the content-addressed store, hash-verified

423// serverHostname returns the hostname of a test server URL, so config can be
424// keyed by host, as production config is, rather than host:port.
425func serverHostname(t *testing.T, rawURL string) string {
426 t.Helper()
427 u, err := url.Parse(rawURL)
428 require.NoError(t, err)
429 return u.Hostname()
430}
431
432func TestHTTPClientSanitizeJSONControlCharactersC0(t *testing.T) {
433 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Calls 1

HelperMethod · 0.65

Tested by

no test coverage detected