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