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/repo
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
..
actions Only check online runner when detecting matching runners in workflows (#28286) (#28512) 1 year ago
setting Preserve BOM in web editor (#28935) (#28959) 1 year ago
activity.go Implement FSFE REUSE for golang files (#21840) 2 years ago
attachment.go More refactoring of `db.DefaultContext` (#27083) 1 year ago
blame.go Use information from previous blame parts (#28572) (#28577) 1 year ago
branch.go Also sync DB branches on push if necessary (#28361) (#28403) 1 year ago
cherry_pick.go Sync branches into databases (#22743) 2 years ago
commit.go Preserve BOM in web editor (#28935) (#28959) 1 year ago
compare.go Preserve BOM in web editor (#28935) (#28959) 1 year ago
download.go Less naked returns (#25713) 2 years ago
editor.go Preserve BOM in web editor (#28935) (#28959) 1 year ago
editor_test.go Move web/api context related testing function into a separate package (#26859) 2 years ago
find.go Implement FSFE REUSE for golang files (#21840) 2 years ago
githttp.go Fix http protocol auth (#27875) (#27876) 1 year ago
githttp_test.go Fix http protocol auth (#27875) (#27876) 1 year ago
helper.go Improve tree not found page (#26570) (#27346) 1 year ago
helper_test.go Make web context initialize correctly for different cases (#26726) 2 years ago
issue.go Refactor issue template parsing and fix API endpoint (#29069) (#29140) 1 year ago
issue_content_history.go Fix missing check (#28406) (#28411) 1 year ago
issue_dependency.go Add context parameter to some database functions (#26055) 2 years ago
issue_label.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
issue_label_test.go Move web/api context related testing function into a separate package (#26859) 2 years ago
issue_lock.go Use fetch form action for lock/unlock/pin/unpin on sidebar (#25380) 2 years ago
issue_pin.go Fix missing check (#28406) (#28411) 1 year ago
issue_stopwatch.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
issue_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_timetrack.go Add context parameter to some database functions (#26055) 2 years ago
issue_watch.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
main_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
middlewares.go Improve user experience for outdated comments (#29050) (#29086) 1 year ago
migrate.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
milestone.go Refactor issue template parsing and fix API endpoint (#29069) (#29140) 1 year ago
packages.go Fix the display of org level badges (#26504) 1 year ago
patch.go Sync branches into databases (#22743) 2 years ago
projects.go Rework markup link rendering (#26745) (#28803) 1 year ago
projects_test.go Move web/api context related testing function into a separate package (#26859) 2 years ago
pull.go Modernize merge button (#28140) (#28786) 1 year ago
pull_review.go Improve user experience for outdated comments (#29050) (#29086) 1 year ago
pull_review_test.go Improve user experience for outdated comments (#29050) (#29086) 1 year ago
release.go Rework markup link rendering (#26745) (#28803) 1 year ago
release_test.go Move web/api context related testing function into a separate package (#26859) 2 years ago
render.go Preserve BOM in web editor (#28935) (#28959) 1 year ago
repo.go Another round of `db.DefaultContext` refactor (#27103) (#27262) 1 year ago
search.go Refactor indexer (#25174) 2 years ago
topic.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
treelist.go Implement FSFE REUSE for golang files (#21840) 2 years ago
view.go Preserve BOM in web editor (#28935) (#28959) 1 year ago
view_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
wiki.go Rework markup link rendering (#26745) (#28803) 1 year ago
wiki_test.go Move web/api context related testing function into a separate package (#26859) 2 years ago