forked from forgejo/forgejo
Refactor routers directory (#15800)
* refactor routers directory * move func used for web and api to common * make corsHandler a function to prohibit side efects * rm unused func Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
e03a91a48e
commit
1bfb0a24d8
107 changed files with 940 additions and 800 deletions
|
@ -17,7 +17,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/repofiles"
|
||||
api "code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/web"
|
||||
"code.gitea.io/gitea/routers/repo"
|
||||
"code.gitea.io/gitea/routers/common"
|
||||
)
|
||||
|
||||
// GetRawFile get a file by path on a repository
|
||||
|
@ -83,7 +83,7 @@ func GetRawFile(ctx *context.APIContext) {
|
|||
}
|
||||
return
|
||||
}
|
||||
if err = repo.ServeBlob(ctx.Context, blob); err != nil {
|
||||
if err = common.ServeBlob(ctx.Context, blob); err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "ServeBlob", err)
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ func GetArchive(ctx *context.APIContext) {
|
|||
ctx.Repo.GitRepo = gitRepo
|
||||
defer gitRepo.Close()
|
||||
|
||||
repo.Download(ctx.Context)
|
||||
common.Download(ctx.Context)
|
||||
}
|
||||
|
||||
// GetEditorconfig get editor config of a repository
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue