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

Function serverHostname

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

324// serverHostname returns the hostname of a test server URL, so config can be
325// keyed by host, as production config is, rather than host:port.
326func serverHostname(t *testing.T, rawURL string) string {
327 t.Helper()
328 u, err := url.Parse(rawURL)
329 require.NoError(t, err)
330 return u.Hostname()
331}
332
333func TestHTTPClientSanitizeJSONControlCharactersC0(t *testing.T) {
334 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers 2

TestHTTPHeadersFunction · 0.85

Calls 1

HelperMethod · 0.65

Tested by

no test coverage detected