Skip to content

Commit 851c6ca

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Bump minimist from 1.2.5 to 1.2.6 (go-gitea#19194) Changelog for 1.16.5 (go-gitea#19189) (go-gitea#19192) Fix showing issues in your repositories (go-gitea#18916) Update issue_no_dependencies description (go-gitea#19112) Prevent redirect to Host (2) (go-gitea#19175) Prevent start panic due to missing DotEscape function Fix compare link in active feeds for new branch (go-gitea#19149) Redirect .wiki/* ui link to /wiki (go-gitea#18831) Try to prevent autolinking of displaynames by email readers (go-gitea#19169) Update HTTP status codes to modern codes (go-gitea#18063)
2 parents 9ebc810 + def5456 commit 851c6ca

File tree

91 files changed

+404
-249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+404
-249
lines changed

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@ This changelog goes through all the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.io).
66

7+
## [1.16.5](https://github.com/go-gitea/gitea/releases/tag/v1.16.5) - 2022-03-23
8+
9+
* BREAKING
10+
* Bump to build with go1.18 (#19120 et al) (#19127)
11+
* SECURITY
12+
* Prevent redirect to Host (2) (#19175) (#19186)
13+
* Try to prevent autolinking of displaynames by email readers (#19169) (#19183)
14+
* Clean paths when looking in Storage (#19124) (#19179)
15+
* Do not send notification emails to inactive users (#19131) (#19139)
16+
* Do not send activation email if manual confirm is set (#19119) (#19122)
17+
* ENHANCEMENTS
18+
* Use the new/choose link for New Issue on project page (#19172) (#19176)
19+
* BUGFIXES
20+
* Fix showing issues in your repositories (#18916) (#19191)
21+
* Fix compare link in active feeds for new branch (#19149) (#19185)
22+
* Redirect .wiki/* ui link to /wiki (#18831) (#19184)
23+
* Ensure deploy keys with write access can push (#19010) (#19182)
24+
* Ensure that setting.LocalURL always has a trailing slash (#19171) (#19177)
25+
* Cleanup protected branches when deleting users & teams (#19158) (#19174)
26+
* Use IterateBufferSize whilst querying repositories during adoption check (#19140) (#19160)
27+
* Fix NPE /repos/issues/search when not signed in (#19154) (#19155)
28+
* Use custom favicon when viewing static files if it exists (#19130) (#19152)
29+
* Fix the editor height in review box (#19003) (#19147)
30+
* Ensure isSSH is set whenever DISABLE_HTTP_GIT is set (#19028) (#19146)
31+
* Fix wrong scopes caused by empty scope input (#19029) (#19145)
32+
* Make migrations SKIP_TLS_VERIFY apply to git too (#19132) (#19141)
33+
* Handle email address not exist (#19089) (#19121)
34+
* MISC
35+
* Update json-iterator to allow compilation with go1.18 (#18644) (#19100)
36+
* Update golang.org/x/crypto (#19097) (#19098)
37+
738
## [1.16.4](https://github.com/go-gitea/gitea/releases/tag/v1.16.4) - 2022-03-14
839

940
* SECURITY

cmd/web_acme.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,5 @@ func runLetsEncryptFallbackHandler(w http.ResponseWriter, r *http.Request) {
128128
// URI always contains a leading slash, which would result in a double
129129
// slash
130130
target := strings.TrimSuffix(setting.AppURL, "/") + r.URL.RequestURI()
131-
http.Redirect(w, r, target, http.StatusFound)
131+
http.Redirect(w, r, target, http.StatusTemporaryRedirect)
132132
}

docs/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ params:
1818
description: Git with a cup of tea
1919
author: The Gitea Authors
2020
website: https://docs.gitea.io
21-
version: 1.16.4
21+
version: 1.16.5
2222
minGoVersion: 1.17
2323
goVersion: 1.18
2424
minNodeVersion: 12.17

integrations/admin_user_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestAdminEditUser(t *testing.T) {
4646
}
4747

4848
func testSuccessfullEdit(t *testing.T, formData user_model.User) {
49-
makeRequest(t, formData, http.StatusFound)
49+
makeRequest(t, formData, http.StatusSeeOther)
5050
}
5151

5252
func makeRequest(t *testing.T, formData user_model.User, headerCode int) {

integrations/api_branch_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func testAPIGetBranchProtection(t *testing.T, branchName string, expectedHTTPSta
3737
req := NewRequestf(t, "GET", "/api/v1/repos/user2/repo1/branch_protections/%s?token=%s", branchName, token)
3838
resp := session.MakeRequest(t, req, expectedHTTPStatus)
3939

40-
if resp.Code == 200 {
40+
if resp.Code == http.StatusOK {
4141
var branchProtection api.BranchProtection
4242
DecodeJSON(t, resp, &branchProtection)
4343
assert.EqualValues(t, branchName, branchProtection.BranchName)
@@ -52,7 +52,7 @@ func testAPICreateBranchProtection(t *testing.T, branchName string, expectedHTTP
5252
})
5353
resp := session.MakeRequest(t, req, expectedHTTPStatus)
5454

55-
if resp.Code == 201 {
55+
if resp.Code == http.StatusCreated {
5656
var branchProtection api.BranchProtection
5757
DecodeJSON(t, resp, &branchProtection)
5858
assert.EqualValues(t, branchName, branchProtection.BranchName)
@@ -65,7 +65,7 @@ func testAPIEditBranchProtection(t *testing.T, branchName string, body *api.Bran
6565
req := NewRequestWithJSON(t, "PATCH", "/api/v1/repos/user2/repo1/branch_protections/"+branchName+"?token="+token, body)
6666
resp := session.MakeRequest(t, req, expectedHTTPStatus)
6767

68-
if resp.Code == 200 {
68+
if resp.Code == http.StatusOK {
6969
var branchProtection api.BranchProtection
7070
DecodeJSON(t, resp, &branchProtection)
7171
assert.EqualValues(t, branchName, branchProtection.BranchName)

integrations/api_helper_for_declarative_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ func doAPICreatePullRequest(ctx APITestContext, owner, repo, baseBranch, headBra
227227
Title: fmt.Sprintf("create a pr from %s to %s", headBranch, baseBranch),
228228
})
229229

230-
expected := 201
230+
expected := http.StatusCreated
231231
if ctx.ExpectedCode != 0 {
232232
expected = ctx.ExpectedCode
233233
}
@@ -246,7 +246,7 @@ func doAPIGetPullRequest(ctx APITestContext, owner, repo string, index int64) fu
246246
owner, repo, index, ctx.Token)
247247
req := NewRequest(t, http.MethodGet, urlStr)
248248

249-
expected := 200
249+
expected := http.StatusOK
250250
if ctx.ExpectedCode != 0 {
251251
expected = ctx.ExpectedCode
252252
}
@@ -287,7 +287,7 @@ func doAPIMergePullRequest(ctx APITestContext, owner, repo string, index int64)
287287

288288
expected := ctx.ExpectedCode
289289
if expected == 0 {
290-
expected = 200
290+
expected = http.StatusOK
291291
}
292292

293293
if !assert.EqualValues(t, expected, resp.Code,
@@ -310,7 +310,7 @@ func doAPIManuallyMergePullRequest(ctx APITestContext, owner, repo, commitID str
310310
ctx.Session.MakeRequest(t, req, ctx.ExpectedCode)
311311
return
312312
}
313-
ctx.Session.MakeRequest(t, req, 200)
313+
ctx.Session.MakeRequest(t, req, http.StatusOK)
314314
}
315315
}
316316

integrations/api_pull_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func TestAPICreatePullSuccess(t *testing.T) {
7777
Base: "master",
7878
Title: "create a failure pr",
7979
})
80-
session.MakeRequest(t, req, 201)
80+
session.MakeRequest(t, req, http.StatusCreated)
8181
session.MakeRequest(t, req, http.StatusUnprocessableEntity) // second request should fail
8282
}
8383

@@ -105,7 +105,7 @@ func TestAPICreatePullWithFieldsSuccess(t *testing.T) {
105105

106106
req := NewRequestWithJSON(t, http.MethodPost, fmt.Sprintf("/api/v1/repos/%s/%s/pulls?token=%s", owner10.Name, repo10.Name, token), opts)
107107

108-
res := session.MakeRequest(t, req, 201)
108+
res := session.MakeRequest(t, req, http.StatusCreated)
109109
pull := new(api.PullRequest)
110110
DecodeJSON(t, res, pull)
111111

@@ -165,20 +165,20 @@ func TestAPIEditPull(t *testing.T) {
165165
Title: "create a success pr",
166166
})
167167
pull := new(api.PullRequest)
168-
resp := session.MakeRequest(t, req, 201)
168+
resp := session.MakeRequest(t, req, http.StatusCreated)
169169
DecodeJSON(t, resp, pull)
170170
assert.EqualValues(t, "master", pull.Base.Name)
171171

172172
req = NewRequestWithJSON(t, http.MethodPatch, fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d?token=%s", owner10.Name, repo10.Name, pull.Index, token), &api.EditPullRequestOption{
173173
Base: "feature/1",
174174
Title: "edit a this pr",
175175
})
176-
resp = session.MakeRequest(t, req, 201)
176+
resp = session.MakeRequest(t, req, http.StatusCreated)
177177
DecodeJSON(t, resp, pull)
178178
assert.EqualValues(t, "feature/1", pull.Base.Name)
179179

180180
req = NewRequestWithJSON(t, http.MethodPatch, fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d?token=%s", owner10.Name, repo10.Name, pull.Index, token), &api.EditPullRequestOption{
181181
Base: "not-exist",
182182
})
183-
session.MakeRequest(t, req, 404)
183+
session.MakeRequest(t, req, http.StatusNotFound)
184184
}

integrations/api_repo_languages_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestRepoLanguages(t *testing.T) {
3333
"content": "package main",
3434
"commit_choice": "direct",
3535
})
36-
session.MakeRequest(t, req, http.StatusFound)
36+
session.MakeRequest(t, req, http.StatusSeeOther)
3737

3838
// let gitea calculate language stats
3939
time.Sleep(time.Second)

integrations/attachment_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func createAttachment(t *testing.T, session *TestSession, repoURL, filename stri
5959
func TestCreateAnonymousAttachment(t *testing.T) {
6060
defer prepareTestEnv(t)()
6161
session := emptyTestSession(t)
62-
createAttachment(t, session, "user2/repo1", "image.png", generateImg(), http.StatusFound)
62+
createAttachment(t, session, "user2/repo1", "image.png", generateImg(), http.StatusSeeOther)
6363
}
6464

6565
func TestCreateIssueAttachment(t *testing.T) {
@@ -83,7 +83,7 @@ func TestCreateIssueAttachment(t *testing.T) {
8383
}
8484

8585
req = NewRequestWithValues(t, "POST", link, postData)
86-
resp = session.MakeRequest(t, req, http.StatusFound)
86+
resp = session.MakeRequest(t, req, http.StatusSeeOther)
8787
test.RedirectURL(resp) // check that redirect URL exists
8888

8989
// Validate that attachment is available

integrations/auth_ldap_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func addAuthSourceLDAP(t *testing.T, sshKeyAttribute string, groupMapParams ...s
135135
"group_team_map_removal": groupTeamMapRemoval,
136136
"user_uid": "DN",
137137
})
138-
session.MakeRequest(t, req, http.StatusFound)
138+
session.MakeRequest(t, req, http.StatusSeeOther)
139139
}
140140

141141
func TestLDAPUserSignin(t *testing.T) {
@@ -202,7 +202,7 @@ func TestLDAPAuthChange(t *testing.T) {
202202
"is_sync_enabled": "on",
203203
"is_active": "on",
204204
})
205-
session.MakeRequest(t, req, http.StatusFound)
205+
session.MakeRequest(t, req, http.StatusSeeOther)
206206

207207
req = NewRequest(t, "GET", href)
208208
resp = session.MakeRequest(t, req, http.StatusOK)

0 commit comments

Comments
 (0)