0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-12-08 17:55:50 +01:00
This commit is contained in:
Lunny Xiao 2025-12-07 10:25:14 -08:00
parent 40ddacfe4f
commit 09c0c456a8
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A

View File

@ -98,7 +98,15 @@ func uploadArchive(t *testing.T, session *TestSession, path string, archive []by
req := NewRequestWithBody(t, "POST", path, bytes.NewReader(body.Bytes())) req := NewRequestWithBody(t, "POST", path, bytes.NewReader(body.Bytes()))
req.Header.Set("Content-Type", writer.FormDataContentType()) req.Header.Set("Content-Type", writer.FormDataContentType())
session.MakeRequest(t, req, http.StatusSeeOther) resp := session.MakeRequest(t, req, http.StatusOK)
doc := NewHTMLParser(t, resp.Body)
token := doc.GetInputValueByName("token")
require.NotEmpty(t, token, "pending upload token not found")
confirmReq := NewRequestWithValues(t, "POST", path+"/confirm", map[string]string{
"_csrf": GetUserCSRFToken(t, session),
"token": token,
})
session.MakeRequest(t, confirmReq, http.StatusSeeOther)
} }
func buildRenderPluginArchive(t *testing.T, id, name, version string) []byte { func buildRenderPluginArchive(t *testing.T, id, name, version string) []byte {