You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/routers/web
wxiaoguang dd8bc1d61d
Refactor issue template parsing and fix API endpoint (#29069) (#29140)
Backport #29069

The old code `GetTemplatesFromDefaultBranch(...) ([]*api.IssueTemplate,
map[string]error)` doesn't really follow Golang's habits, then the
second returned value might be misused. For example, the API function
`GetIssueTemplates` incorrectly checked the second returned value and
always responds 500 error.

This PR refactors GetTemplatesFromDefaultBranch to
ParseTemplatesFromDefaultBranch and clarifies its behavior, and fixes
the API endpoint bug, and adds some tests.

And by the way, add proper prefix `X-` for the header generated in
`checkDeprecatedAuthMethods`, because non-standard HTTP headers should
have `X-` prefix, and it is also consistent with the new code in
`GetIssueTemplates`
1 year ago
..
admin Forbid removing the last admin user (#28337) (#28793) 1 year ago
auth Avoid cycle-redirecting user/login page (#28636) (#28658) 1 year ago
devtest Make "cancel" buttons have proper type in modal forms (#25618) 2 years ago
events Implement FSFE REUSE for golang files (#21840) 2 years ago
explore Next round of `db.DefaultContext` refactor (#27089) 1 year ago
feed Rework markup link rendering (#26745) (#28803) 1 year ago
healthcheck Remove `db.DefaultContext` in `routers/` and `cmd/` (#26076) 2 years ago
misc Refactor CORS handler (#28587) (#28611) 1 year ago
org Rework markup link rendering (#26745) (#28803) 1 year ago
repo Refactor issue template parsing and fix API endpoint (#29069) (#29140) 1 year ago
shared Rework markup link rendering (#26745) (#28803) 1 year ago
user Rework markup link rendering (#26745) (#28803) 1 year ago
base.go Fix panic in storageHandler (#27446) (#27479) 1 year ago
githttp.go Refactor CORS handler (#28587) (#28611) 1 year ago
goget.go Support SSH for go get (#24664) 2 years ago
home.go Reduce usage of `db.DefaultContext` (#27073) 1 year ago
metrics.go Implement FSFE REUSE for golang files (#21840) 2 years ago
nodeinfo.go Implement FSFE REUSE for golang files (#21840) 2 years ago
swagger_json.go Start using template context function (#26254) 2 years ago
web.go Refactor CORS handler (#28587) (#28611) 1 year ago
webfinger.go Add a link to OpenID Issuer URL in WebFinger response (#26000) 2 years ago