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

Function serverHostname

api/http_client_test.go:424–429  ·  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

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

Calls 1

HelperMethod · 0.65

Tested by

no test coverage detected