0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-07 14:49:09 +01:00
gitea/routers/web
wxiaoguang ee242a08e9
Refactor issue template parsing and fix API endpoint (#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`
2024-02-12 05:04:10 +00:00
..
admin Unify user update methods (#28733) 2024-02-04 13:29:09 +00:00
auth Unify user update methods (#28733) 2024-02-04 13:29:09 +00:00
devtest Make "cancel" buttons have proper type in modal forms (#25618) 2023-07-03 14:04:50 +08:00
events Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
explore Allow to set explore page default sort (#27951) 2023-11-09 10:11:45 +00:00
feed Update tool dependencies (#29030) 2024-02-02 19:11:39 -05:00
healthcheck Always enable caches (#28527) 2023-12-19 09:29:05 +00:00
misc Refactor CORS handler (#28587) 2023-12-25 20:13:18 +08:00
org Unify user update methods (#28733) 2024-02-04 13:29:09 +00:00
repo Refactor issue template parsing and fix API endpoint (#29069) 2024-02-12 05:04:10 +00:00
shared Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
user Unify user update methods (#28733) 2024-02-04 13:29:09 +00:00
base.go Fix panic in storageHandler (#27446) 2023-10-06 13:23:14 +00:00
githttp.go Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
goget.go Support SSH for go get (#24664) 2023-05-12 09:44:37 +00:00
home.go Enhanced auth token / remember me (#27606) 2023-10-14 00:56:41 +00:00
metrics.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
nodeinfo.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
swagger_json.go Start using template context function (#26254) 2023-08-08 01:22:47 +00:00
web.go Fix inconsistent naming of OAuth 2.0 ENABLE setting (#28951) 2024-01-28 12:36:44 +00:00
webfinger.go Add a link to OpenID Issuer URL in WebFinger response (#26000) 2023-07-20 16:02:45 +08:00