Commit Graph

9 Commits (fa0c8ae50f6f69fcea64d4b22d5f257649f78bea)

Author SHA1 Message Date
wxiaoguang f24d73ab5f
Fix "redirect link" handling ()
`a%2fb` should not redirect to `a/b`

---------

Co-authored-by: delvh <dev.lh@web.de>
wxiaoguang 65aae0912a
Fix raw file API ref handling ()
Fix  and add more tests
Chai-Shi 0387195abb
[Feature] Private README.md for organization ()
Implemented 

---------

Co-authored-by: Ben Chang <ben_chang@htc.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
wxiaoguang 6d5aa9218e
Refactor request context ()
Introduce RequestContext: is a short-lived context that is used to store
request-specific data.

RequestContext could be used to clean form tmp files, close context git
repo, and do some tracing in the future.

Then a lot of legacy code could be removed or improved. For example:
most `ctx.Repo.GitRepo.Close()` could be removed because the git repo
could be closed when the request is done.
wxiaoguang 61c35590c7
Refactor RepoRefByType ()
1. clarify the "filepath" could(should) contain "{ref}"
2. remove unclear RepoRefLegacy and RepoRefAny, use RepoRefUnknown to guess
3. by the way, avoid using AppURL
Lunny Xiao d6d3c96e65
Fix bug when a token is given public only ()
wxiaoguang 43c7a2e7b1
Refactor names ()
This PR only does "renaming":

* `Route` should be `Router` (and chi router is also called "router")
* `Params` should be `PathParam` (to distingush it from URL query param, and to match `FormString`)
* Use lower case for private functions to avoid exposing or abusing
wxiaoguang c248f010ad
Refactor cache and disable go-chi cache ()
use built-in cache package to wrap external go-chi cache package
Lunny Xiao 29f149bd9f
Move context from modules to services ()
Since `modules/context` has to depend on `models` and many other
packages, it should be moved from `modules/context` to
`services/context` according to design principles. There is no logic
code change on this PR, only move packages.

- Move `code.gitea.io/gitea/modules/context` to
`code.gitea.io/gitea/services/context`
- Move `code.gitea.io/gitea/modules/contexttest` to
`code.gitea.io/gitea/services/contexttest` because of depending on
context
- Move `code.gitea.io/gitea/modules/upload` to
`code.gitea.io/gitea/services/context/upload` because of depending on
context