forked from forgejo/forgejo
[GITEA] Fix API inconsistencies
- Document the correct content types for Git archives. Add code that
actually sets the correct application type for `.zip` and `.tar.gz`.
- When an action (POST/PUT/DELETE method) was successful, an 204 status
code should be returned instead of status code 200.
- Add and adjust integration testing.
- Resolves #2180
- Resolves #2181
(cherry picked from commit 6c8c4512b5
)
This commit is contained in:
parent
28ecd6f5a6
commit
3f74bcb14d
5 changed files with 23 additions and 6 deletions
|
@ -254,14 +254,14 @@ func TestAPIRenameUser(t *testing.T) {
|
|||
// required
|
||||
"new_name": "User2",
|
||||
}).AddTokenAuth(token)
|
||||
MakeRequest(t, req, http.StatusOK)
|
||||
MakeRequest(t, req, http.StatusNoContent)
|
||||
|
||||
urlStr = fmt.Sprintf("/api/v1/admin/users/%s/rename", "User2")
|
||||
req = NewRequestWithValues(t, "POST", urlStr, map[string]string{
|
||||
// required
|
||||
"new_name": "User2-2-2",
|
||||
}).AddTokenAuth(token)
|
||||
MakeRequest(t, req, http.StatusOK)
|
||||
MakeRequest(t, req, http.StatusNoContent)
|
||||
|
||||
req = NewRequestWithValues(t, "POST", urlStr, map[string]string{
|
||||
// required
|
||||
|
@ -281,7 +281,7 @@ func TestAPIRenameUser(t *testing.T) {
|
|||
// required
|
||||
"new_name": "user2",
|
||||
}).AddTokenAuth(token)
|
||||
MakeRequest(t, req, http.StatusOK)
|
||||
MakeRequest(t, req, http.StatusNoContent)
|
||||
}
|
||||
|
||||
func TestAPICron(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue