mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-05 23:44:22 +00:00
Remove extra argument
This commit is contained in:
@@ -241,16 +241,11 @@ func (h *testHarness) addAuthCookies(t *testing.T, req *http.Request, session *m
|
||||
}
|
||||
|
||||
// makeRequest is the main helper for making JSON requests
|
||||
func (h *testHarness) makeRequest(t *testing.T, method, path string, body interface{}, session *models.Session, headers map[string]string) *httptest.ResponseRecorder {
|
||||
func (h *testHarness) makeRequest(t *testing.T, method, path string, body interface{}, session *models.Session) *httptest.ResponseRecorder {
|
||||
t.Helper()
|
||||
|
||||
req := h.newRequest(t, method, path, body)
|
||||
|
||||
// Add custom headers
|
||||
for k, v := range headers {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
if session != nil {
|
||||
needsCSRF := method != http.MethodGet && method != http.MethodHead && method != http.MethodOptions
|
||||
csrfToken := h.addAuthCookies(t, req, session, needsCSRF)
|
||||
@@ -263,16 +258,11 @@ func (h *testHarness) makeRequest(t *testing.T, method, path string, body interf
|
||||
}
|
||||
|
||||
// makeRequestRawWithHeaders adds support for custom headers with raw body
|
||||
func (h *testHarness) makeRequestRaw(t *testing.T, method, path string, body io.Reader, session *models.Session, headers map[string]string) *httptest.ResponseRecorder {
|
||||
func (h *testHarness) makeRequestRaw(t *testing.T, method, path string, body io.Reader, session *models.Session) *httptest.ResponseRecorder {
|
||||
t.Helper()
|
||||
|
||||
req := h.newRequestRaw(t, method, path, body)
|
||||
|
||||
// Add custom headers
|
||||
for k, v := range headers {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
|
||||
if session != nil {
|
||||
needsCSRF := method != http.MethodGet && method != http.MethodHead && method != http.MethodOptions
|
||||
csrfToken := h.addAuthCookies(t, req, session, needsCSRF)
|
||||
|
||||
Reference in New Issue
Block a user