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)
| 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. |
| 424 | func 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 | |
| 431 | func TestHTTPClientSanitizeJSONControlCharactersC0(t *testing.T) { |
| 432 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
no test coverage detected