(t *testing.T)
| 232 | } |
| 233 | |
| 234 | func TestGetCanSkipAuthHeaders(t *testing.T) { |
| 235 | client := newTestClient(t, false, func(req *http.Request) (*http.Response, error) { |
| 236 | if req.Method != http.MethodGet { |
| 237 | t.Fatalf("expected GET request, got %s", req.Method) |
| 238 | } |
| 239 | if got := req.Header.Get("Authorization"); got != "" { |
| 240 | t.Fatalf("expected no auth header, got %q", got) |
| 241 | } |
| 242 | if got := req.Header.Get("X-Cli-Id"); got != "" { |
| 243 | t.Fatalf("expected no cli id header, got %q", got) |
| 244 | } |
| 245 | |
| 246 | return response(http.StatusOK, "ok"), nil |
| 247 | }) |
| 248 | |
| 249 | status, data, err := client.get((&url.URL{ |
| 250 | Scheme: "https", |
| 251 | Host: "example.com", |
| 252 | Path: "/health", |
| 253 | }).String(), false) |
| 254 | if err != nil { |
| 255 | t.Fatalf("get returned error: %v", err) |
| 256 | } |
| 257 | if status != http.StatusOK { |
| 258 | t.Fatalf("expected status 200, got %d", status) |
| 259 | } |
| 260 | if string(data) != "ok" { |
| 261 | t.Fatalf("unexpected response body: %s", string(data)) |
| 262 | } |
| 263 | } |
nothing calls this directly
no test coverage detected