(t *testing.T, url string, statusCode int)
| 1348 | } |
| 1349 | |
| 1350 | func httpGet(t *testing.T, url string, statusCode int) *http.Response { |
| 1351 | resp, err := http.Get(url) |
| 1352 | if err != nil { |
| 1353 | t.Fatalf("unexpected erorr while doing GET request: %s", err) |
| 1354 | } |
| 1355 | if resp.StatusCode != statusCode { |
| 1356 | t.Fatalf("unexpected status code: %d; expected: %d", resp.StatusCode, statusCode) |
| 1357 | } |
| 1358 | return resp |
| 1359 | } |
| 1360 | |
| 1361 | func checkHeader(t *testing.T, resp *http.Response, header string, expected string) { |
| 1362 | t.Helper() |