(endpoint string, header http.Header)
| 1712 | } |
| 1713 | |
| 1714 | func (test *ajaxRequestTest) getEndpoint(endpoint string, header http.Header) (int, http.Header, []byte, error) { |
| 1715 | rw := httptest.NewRecorder() |
| 1716 | req, err := http.NewRequest(http.MethodGet, endpoint, strings.NewReader("")) |
| 1717 | if err != nil { |
| 1718 | return 0, nil, nil, err |
| 1719 | } |
| 1720 | req.Header = header |
| 1721 | test.proxy.ServeHTTP(rw, req) |
| 1722 | return rw.Code, rw.Header(), rw.Body.Bytes(), nil |
| 1723 | } |
| 1724 | |
| 1725 | func testAjaxUnauthorizedRequest(t *testing.T, header http.Header, forceJSONErrors bool) { |
| 1726 | test, err := newAjaxRequestTest(forceJSONErrors) |
no test coverage detected