aboutsummaryrefslogtreecommitdiffstats
path: root/services/context/base.go
Commit message (Collapse)AuthorAgeFilesLines
* Refactor error system (#33610)wxiaoguang2025-02-161-2/+2
|
* Feature: Support workflow event dispatch via API (#33545)wxiaoguang2025-02-111-0/+4
| | | | | | | | | Fix: https://github.com/go-gitea/gitea/issues/31765 (Re-open #32059) --------- Co-authored-by: Bence Santha <git@santha.eu> Co-authored-by: Bence Sántha <7604637+bencurio@users.noreply.github.com> Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
* Prepare for support performance trace (#33286)wxiaoguang2025-01-151-13/+11
| | | For #32973
* Clarify path param naming (#32969)wxiaoguang2024-12-241-92/+0
| | | | | | | | | In history (from some legacy frameworks), both `:name` and `name` are supported as path path name, `:name` is an alias to `name`. To make code consistent, now we should only use `name` but not `:name`. Also added panic check in related functions to make sure the name won't be abused in case some downstreams still use them.
* Refactor request context (#32956)wxiaoguang2024-12-241-62/+26
| | | | | | | | | | | 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.
* Fix LFS route mock, realm, middleware names (#32488)wxiaoguang2024-11-131-0/+5
| | | | | | | | | | 1. move "internal-lfs" route mock to "common-lfs" 2. fine tune tests 3. fix "realm" strings, according to RFC: https://datatracker.ietf.org/doc/html/rfc2617: * realm = "realm" "=" realm-value * realm-value = quoted-string 4. clarify some names of the middlewares, rename `ignXxx` to `optXxx` to match `reqXxx`, and rename ambiguous `requireSignIn` to `reqGitSignIn`
* Refactor names (#31405)wxiaoguang2024-06-191-7/+7
| | | | | | | 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
* Refactor route path normalization (#31381)wxiaoguang2024-06-171-7/+12
| | | | Refactor route path normalization and decouple it from the chi router. Fix the TODO, fix the legacy strange path behavior.
* Check if reverse proxy is correctly configured (#30890)wxiaoguang2024-05-101-1/+2
| | | | | | | | | Follow #27011 Follow #30885 --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
* Refactor AppURL usage (#30885)wxiaoguang2024-05-071-1/+1
| | | | | | | | Fix #30883 Fix #29591 --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Ignore useless error message "broken pipe" (#30801)wxiaoguang2024-05-031-3/+1
| | | Fix #30792
* Use strict protocol check when redirect (#29642)wxiaoguang2024-03-071-1/+1
|
* Let ctx.FormOptionalBool() return optional.Option[bool] (#29461)65432024-02-281-6/+6
| | | | just some refactoring bits towards replacing **util.OptionalBool** with **optional.Option[bool]**
* Move context from modules to services (#29440)Lunny Xiao2024-02-271-0/+317
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