mirror of
https://github.com/go-gitea/gitea
synced 2024-11-22 21:02:33 +01:00
ee242a08e9
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` |
||
---|---|---|
.. | ||
assignee.go | ||
assignee_test.go | ||
comments.go | ||
commit.go | ||
commit_test.go | ||
content.go | ||
issue.go | ||
issue_test.go | ||
label.go | ||
label_test.go | ||
main_test.go | ||
milestone.go | ||
milestone_test.go | ||
status.go | ||
template.go |