aboutsummaryrefslogtreecommitdiffstats
path: root/integrations
Commit message (Collapse)AuthorAgeFilesLines
* Remove dependent on session auth for api/v1 routers (#19321)Lunny Xiao2022-04-088-93/+87
| | | | | | | | | | | * Remove dependent on session auth for api/v1 routers * Remove unnecessary session on API context * remove missed header * fix test * fix missed api/v1
* Never use /api/v1 from Gitea UI Pages (#19318)Lunny Xiao2022-04-074-0/+309
| | | | | | | | | | | | | Reusing `/api/v1` from Gitea UI Pages have pros and cons. Pros: 1) Less code copy Cons: 1) API/v1 have to support shared session with page requests. 2) You need to consider for each other when you want to change something about api/v1 or page. This PR moves all dependencies to API/v1 from UI Pages. Partially replace #16052
* Package registry changes (#19305)KN4CK3R2022-04-061-3/+30
| | | | | | | | * removed debug logs * fixed SELECT * removed unneeded error type * use common SearchVersions method * remove empty container upload versions * return err
* Remove legacy unmaintained packages, refactor to support change default ↵wxiaoguang2022-04-038-11/+12
| | | | | | | | | | locale (#19308) Remove two unmaintained vendor packages `i18n` and `paginater`. Changes: * Rewrite `i18n` package with a more clear fallback mechanism. Fix an unstable `Tr` behavior, add more tests. * Refactor the legacy `Paginater` to `Paginator`, test cases are kept unchanged. Trivial enhancement (no breaking for end users): * Use the first locale in LANGS setting option as the default, add a log to prevent from surprising users.
* An attempt to sync a non-mirror repo must give 400 (Bad Request) (#19300)Peter Gardfjäll2022-04-011-0/+21
| | | | | | | | * An attempt to sync a non-mirror repo must give 400 (Bad Request) * add missing return statement Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Remove legacy `unknwon/com` package (#19298)wxiaoguang2022-04-022-3/+4
| | | | | | | Follows: #19284 * The `CopyDir` is only used inside test code * Rewrite `ToSnakeCase` with more test cases * The `RedisCacher` only put strings into cache, here we use internal `toStr` to replace the legacy `ToStr` * The `UniqueQueue` can use string as ID directly, no need to call `ToStr`
* A pull-mirror repo should be marked as such on creation (#19295)Peter Gardfjäll2022-04-011-0/+1
| | | | | Right now, a pull-mirror repo does not get marked as such until *after* the mirroring completes. In the meantime, it will show up (in API and UI) as a regular repo.
* Refactor legacy `unknwon/com` package, improve golangci lint (#19284)wxiaoguang2022-04-011-2/+1
| | | | | | | | The main purpose is to refactor the legacy `unknwon/com` package. 1. Remove most imports of `unknwon/com`, only `util/legacy.go` imports the legacy `unknwon/com` 2. Use golangci's depguard to process denied packages 3. Fix some incorrect values in golangci.yml, eg, the version should be quoted string `"1.18"` 4. Use correctly escaped content for `go-import` and `go-source` meta tags 5. Refactor `com.Expand` to our stable (and the same fast) `vars.Expand`, our `vars.Expand` can still return partially rendered content even if the template is not good (eg: key mistach).
* Remove `git.Command.Run` and `git.Command.RunInDir*` (#19280)wxiaoguang2022-04-015-38/+36
| | | | | | Follows #19266, #8553, Close #18553, now there are only three `Run..(&RunOpts{})` functions. * before: `stdout, err := RunInDir(path)` * now: `stdout, _, err := RunStdString(&git.RunOpts{Dir:path})`
* Update JS dependencies (#19281)silverwind2022-04-011-1/+1
| | | | | | - Upgrade all JS dependencies minus vue and vue-loader - Adapt to breaking change of octicons - Update eslint rules - Tested Swagger UI, sortablejs and prod build
* Update reserved usernames list (#18438)Gusted2022-03-311-4/+22
| | | | | Adding additional usernames which are already routes, remove unused ones. In future, avoid reserving names as much as possible, use `/-/` in path instead.
* Add Package Registry (#16510)KN4CK3R2022-03-3010-0/+2898
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added package store settings. * Added models. * Added generic package registry. * Added tests. * Added NuGet package registry. * Moved service index to api file. * Added NPM package registry. * Added Maven package registry. * Added PyPI package registry. * Summary is deprecated. * Changed npm name. * Sanitize project url. * Allow only scoped packages. * Added user interface. * Changed method name. * Added missing migration file. * Set page info. * Added documentation. * Added documentation links. * Fixed wrong error message. * Lint template files. * Fixed merge errors. * Fixed unit test storage path. * Switch to json module. * Added suggestions. * Added package webhook. * Add package api. * Fixed swagger file. * Fixed enum and comments. * Fixed NuGet pagination. * Print test names. * Added api tests. * Fixed access level. * Fix User unmarshal. * Added RubyGems package registry. * Fix lint. * Implemented io.Writer. * Added support for sha256/sha512 checksum files. * Improved maven-metadata.xml support. * Added support for symbol package uploads. * Added tests. * Added overview docs. * Added npm dependencies and keywords. * Added no-packages information. * Display file size. * Display asset count. * Fixed filter alignment. * Added package icons. * Formatted instructions. * Allow anonymous package downloads. * Fixed comments. * Fixed postgres test. * Moved file. * Moved models to models/packages. * Use correct error response format per client. * Use simpler search form. * Fixed IsProd. * Restructured data model. * Prevent empty filename. * Fix swagger. * Implemented user/org registry. * Implemented UI. * Use GetUserByIDCtx. * Use table for dependencies. * make svg * Added support for unscoped npm packages. * Add support for npm dist tags. * Added tests for npm tags. * Unlink packages if repository gets deleted. * Prevent user/org delete if a packages exist. * Use package unlink in repository service. * Added support for composer packages. * Restructured package docs. * Added missing tests. * Fixed generic content page. * Fixed docs. * Fixed swagger. * Added missing type. * Fixed ambiguous column. * Organize content store by sha256 hash. * Added admin package management. * Added support for sorting. * Add support for multiple identical versions/files. * Added missing repository unlink. * Added file properties. * make fmt * lint * Added Conan package registry. * Updated docs. * Unify package names. * Added swagger enum. * Use longer TEXT column type. * Removed version composite key. * Merged package and container registry. * Removed index. * Use dedicated package router. * Moved files to new location. * Updated docs. * Fixed JOIN order. * Fixed GROUP BY statement. * Fixed GROUP BY #2. * Added symbol server support. * Added more tests. * Set NOT NULL. * Added setting to disable package registries. * Moved auth into service. * refactor * Use ctx everywhere. * Added package cleanup task. * Changed packages path. * Added container registry. * Refactoring * Updated comparison. * Fix swagger. * Fixed table order. * Use token auth for npm routes. * Enabled ReverseProxy auth. * Added packages link for orgs. * Fixed anonymous org access. * Enable copy button for setup instructions. * Merge error * Added suggestions. * Fixed merge. * Handle "generic". * Added link for TODO. * Added suggestions. * Changed temporary buffer filename. * Added suggestions. * Apply suggestions from code review Co-authored-by: Thomas Boerger <thomas@webhippie.de> * Update docs/content/doc/packages/nuget.en-us.md Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Thomas Boerger <thomas@webhippie.de>
* Make git.OpenRepository accept Context (#19260)65432022-03-3012-19/+21
| | | | | * OpenRepositoryCtx -> OpenRepository * OpenRepository -> openRepositoryWithDefaultContext, only for internal usage
* Move organization related structs into sub package (#18518)Lunny Xiao2022-03-295-30/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move organization related structs into sub package * Fix test * Fix lint * Move more functions into sub packages * Fix bug * Fix test * Update models/organization/team_repo.go Co-authored-by: KN4CK3R <admin@oldschoolhack.me> * Apply suggestions from code review Co-authored-by: KN4CK3R <admin@oldschoolhack.me> * Fix fmt * Follow suggestion from @Gusted * Fix test * Fix test * Fix bug * Use ctx but db.DefaultContext on routers * Fix bug * Fix bug * fix bug * Update models/organization/team_user.go * Fix bug Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Allow API to create file on empty repo (#19224)zeripath2022-03-281-8/+32
| | | | | | | | This PR adds the necessary work to make it possible to create files on empty repos using the API. Fix #10993 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add `ContextUser` to http request context (#18798)KN4CK3R2022-03-261-1/+1
| | | | | This PR adds a middleware which sets a ContextUser (like GetUserByParams before) in a single place which can be used by other methods. For routes which represent a repo or org the respective middlewares set the field too. Also fix a bug in modules/context/org.go during refactoring.
* Update HTTP status codes to modern codes (#18063)KN4CK3R2022-03-2335-106/+107
| | | | | | * 2xx/3xx/4xx/5xx -> http.Status... * http.StatusFound -> http.StatusTemporaryRedirect * http.StatusMovedPermanently -> http.StatusPermanentRedirect
* Fix the bug: deploy key with write access can not push (#19010)wxiaoguang2022-03-221-5/+5
| | | Use DeployKeyID to replace the IsDeployKey, then CanWriteCode uses the DeployKeyID to check the write permission.
* Renamed ctx.User to ctx.Doer. (#19161)KN4CK3R2022-03-222-8/+8
| | | | Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* rm .sample hooks which aren't used (#19101)techknowlogick2022-03-16234-13256/+0
|
* Add Index to comment for migrations and mirroring (#18806)singuliere2022-03-061-1/+3
| | | | | | | | | | | | Comments have an id (see Gitea[0], GitLab[1], GitHub[2], etc.), and the comment migration format must represent it during migrations so that it can be used during mirroring or incremental migrations. [0] https://try.gitea.io/api/swagger#/issue/issueGetComment [1] https://docs.gitlab.com/ee/api/discussions.html#get-single-issue-discussion-item [2] https://docs.github.com/en/rest/reference/issues#get-an-issue-comment Signed-off-by: Loïc Dachary <loic@dachary.org> Co-authored-by: Loïc Dachary <loic@dachary.org>
* Add note to GPG key response if user has no keys (#18961)KN4CK3R2022-03-021-0/+1
| | | | | | | | | | | * Prevent invalid key response. * Display note instead of 404 response. * Fixed test. Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix page and missing return on unadopted repos API (#18848)qwerty2872022-02-271-1/+0
| | | | | | | | | * Fix page and missing return on unadopted repos API Page must be 1 if it's not specified and it should return after sending an internal server error. * Allow ignore pages Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Set is_empty in fixtures (#18869)KN4CK3R2022-02-262-0/+7
|
* migrations: add test for importing pull requests in gitea uploader (#18752)singuliere2022-02-251-0/+5
| | | | | | | | | | | | | | | | | | | * logs: add the buffer logger to inspect logs during testing Signed-off-by: Loïc Dachary <loic@dachary.org> * migrations: add test for importing pull requests in gitea uploader Signed-off-by: Loïc Dachary <loic@dachary.org> * for each git.OpenRepositoryCtx, call Close * Content is expected to return the content of the log * test for errors before defer Co-authored-by: Loïc Dachary <loic@dachary.org> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix ldap loginname (#18789)Johan Van de Wauw2022-02-181-2/+0
| | | | | | | | | | | | | | | | | | | | * Use email_address table to check user's email when login with email adress * Update services/auth/signin.go * Fix test * Fix test * Fix logging in with ldap username != loginname * Fix if user does not exist yet * Make more clear this is loginName * Fix formatting Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Add LDAP group sync to Teams, fixes #1395 (#16299)Sven Seeberg2022-02-111-1/+118
| | | | | | | | | | * Add setting for a JSON that maps LDAP groups to Org Teams. * Add log when removing or adding team members. * Sync is being run on login and periodically. * Existing group filter settings are reused. * Adding and removing team members. * Sync not existing LDAP group. * Login with broken group map JSON.
* Change git.cmd to RunWithContext (#18693)Martin Scholz2022-02-111-2/+15
| | | | | | | Change all `cmd...Pipeline` commands to `cmd.RunWithContext`. #18553 Co-authored-by: Martin Scholz <martin.scholz@versasec.com>
* tests: remove redundant comparison in repo dump/restore (#18660)singuliere2022-02-101-9/+0
| | | | | | | It is a leftover forgotten in https://github.com/go-gitea/gitea/pull/18621 Signed-off-by: singuliere <singuliere@autistici.org> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add separate SSH_USER config option (#17584)Clar Fon2022-02-071-1/+1
| | | Co-authored-by: zeripath <art27@cantab.net>
* more repo dump/restore tests, including pull requests (#18621)singuliere2022-02-071-36/+235
| | | | | | | | | | | | | | | | | | | | | The tests were refactored so that all YAML files content are checked, unless an exception is set (for instance for the Updated field which is automatically updated by the database and cannot be expected to be identical over a dump/restore/dump round. This approach helps catch more errors where fields are added in the migration files because they do not need to be added to the tests to be verified. It also helps as a reminder of what is left to be implemented, such as the the Assignees field in issues. A helper is added to keep the tests DRY and facilitate their maintenance. Signed-off-by: Loïc Dachary <loic@dachary.org> Co-authored-by: Loïc Dachary <loic@dachary.org> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Delete old git.NewCommand() and use it as git.NewCommandContext() (#18552)65432022-02-065-27/+27
|
* preserve users if restoring a repository on the same Gitea instance (#18604)singuliere2022-02-061-0/+1
| | | | | | | | | | | | | | | | | | | | | When calling DumpRepository and RestoreRepository on the same Gitea instance, the users are preserved: all labels, issues etc. belong to the external user who is, in this particular case, the local user. Dead code verifying g.gitServiceType.Name() == "" (i.e. plain git) is removed. The function is never called because the plain git downloader does not migrate anything that is associated to a user, by definition. Errors returned by GetUserIDByExternalUserID are no longer ignored. The userMap is used when the external user is not kown, which is the most common case. It was only used when the external user exists which happens less often and, as a result, every occurence of an unknown external user required a SQL query. Signed-off-by: Loïc Dachary <loic@dachary.org> Co-authored-by: Loïc Dachary <loic@dachary.org> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Use `CryptoRandomBytes` instead of `CryptoRandomString` (#18439)Gusted2022-02-041-1/+1
| | | | | | - Switch to use `CryptoRandomBytes` instead of `CryptoRandomString`, OAuth's secrets are copied pasted and don't need to avoid dubious characters etc. - `CryptoRandomBytes` gives ![2^256 = 1.15 * 10^77](https://render.githubusercontent.com/render/math?math=2^256%20=%201.15%20\cdot%2010^77) `CryptoRandomString` gives ![62^44 = 7.33 * 10^78](https://render.githubusercontent.com/render/math?math=62^44%20=%207.33%20\cdot%2010^78) possible states. - Add a prefix, such that code scanners can easily grep these in source code. - 32 Bytes + prefix
* Attempt to prevent intermittent failure ↵zeripath2022-01-291-10/+14
| | | | | | | | | | | | | | | | | | TestGit/xxx/BranchProtectMerge/MergePR (#18451) One of the repeated intermittent failures we see in testing is a failure due to branches not being ready to merge. Prior to the immediate queue implementation we would attempt to flush all the queues and this would prevent the issue. However, the immediate queue is not flushable so the flushall is not successful at preventing this. This PR proposes an alternative solution - wait some time and try again up to 5 times. If this fails then there is a genuine issue and we should fail. Related #17719 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Ensure git tag tests and others create test repos in tmpdir (#18447)zeripath2022-01-295-5/+5
| | | | | | | | | | | | | | | | | | | | * Ensure git tag tests and other create test repos in tmpdir There are a few places where tests appear to reuse testing repos which causes random CI failures. This PR simply changes these tests to ensure that cloning always happens into new temporary directories. Fix #18444 * Change log root for integration tests to use the REPO_TEST_DIR There is a potential race in the drone integration tests whereby test-mysql etc will start writing to log files causing make test-check fail. Fix #18077 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Automatically pause queue if index service is unavailable (#15066)Lauris BH2022-01-271-4/+1
| | | | | | * Handle keyword search error when issue indexer service is not available * Implement automatic disabling and resume of code indexer queue
* Validate migration files (#18203)Aravinth Manivannan2022-01-261-1/+1
| | | | | | | JSON Schema validation for data used by Gitea during migrations Discussion at https://forum.forgefriends.org/t/common-json-schema-for-repository-information/563 Co-authored-by: Loïc Dachary <loic@dachary.org>
* Unexport git.GlobalCommandArgs (#18376)65432022-01-253-23/+7
| | | | Unexport the git.GlobalCommandArgs variable.
* Fix partial cloning a repo (#18373)Gusted2022-01-232-0/+17
| | | | | | | | - Pass the Global command args into serviceRPC. - Fixes error with partial cloning. - Add partial clone test - Include diff Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Switch to non-deprecation setting (#18358)Gusted2022-01-234-4/+12
| | | | | | * Switch to non-deprecation setting (Avoid by-default: "Deprecated fallback `[server]` `LFS_CONTENT_PATH` present. Use `[lfs]` `PATH` instead. This fallback will be removed in v1.18.0") * Update all references
* format with gofumpt (#18184)65432022-01-2048-239/+257
| | | | | | | | | | | * gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
* Propagate context and ensure git commands run in request context (#17868)zeripath2022-01-1910-37/+40
| | | | | | | | | This PR continues the work in #17125 by progressively ensuring that git commands run within the request context. This now means that the if there is a git repo already open in the context it will be used instead of reopening it. Signed-off-by: Andrew Thornton <art27@cantab.net>
* migrations: a deadline at January 1st, 1970 is valid (#18237)Aravinth Manivannan2022-01-131-6/+37
| | | | | | | | | | | | | | | | | | | | | | | | | * migrations: a deadline at January 1st, 1970 is valid Do not change the deadline value if it is set to January 1st, 1970. Setting the deadline to year 9999 when it is zero (which is equal to January 1st, 1970) modifies a deadline set to January 1st, 1970 which is a valid date. In addition, setting a date in year 9999 will be converted to a null date in some cases. Signed-off-by: Loïc Dachary <loic@dachary.org> * tests: set milestone.deadline_unix in fixtures The value of deadline_unix must be set to 253370764800 (i.e. 9999-01-01) in fixtures, otherwise it will be inserted as null which leads to unexpected errors. For instance, DumpRepository will store a null deadline_unix as 0 (i.e. 1970-01-01) and RestoreRepository will change it to 9999-01-01. Signed-off-by: Loïc Dachary <loic@dachary.org> Co-authored-by: Loïc Dachary <loic@dachary.org> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Team permission allow different unit has different permission (#17811)Lunny Xiao2022-01-053-23/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Team permission allow different unit has different permission * Finish the interface and the logic * Fix lint * Fix translation * align center for table cell content * Fix fixture * merge * Fix test * Add deprecated * Improve code * Add tooltip * Fix swagger * Fix newline * Fix tests * Fix tests * Fix test * Fix test * Max permission of external wiki and issues should be read * Move team units with limited max level below units table * Update label and column names * Some improvements * Fix lint * Some improvements * Fix template variables * Add permission docs * improve doc * Fix fixture * Fix bug * Fix some bug * fix * gofumpt * Integration test for migration (#18124) integrations: basic test for Gitea {dump,restore}-repo This is a first step for integration testing of DumpRepository and RestoreRepository. It: runs a Gitea server, dumps a repo via DumpRepository to the filesystem, restores the repo via RestoreRepository from the filesystem, dumps the restored repository to the filesystem, compares the first and second dump and expects them to be identical The verification is trivial and the goal is to add more tests for each topic of the dump. Signed-off-by: Loïc Dachary <loic@dachary.org> * Team permission allow different unit has different permission * Finish the interface and the logic * Fix lint * Fix translation * align center for table cell content * Fix fixture * merge * Fix test * Add deprecated * Improve code * Add tooltip * Fix swagger * Fix newline * Fix tests * Fix tests * Fix test * Fix test * Max permission of external wiki and issues should be read * Move team units with limited max level below units table * Update label and column names * Some improvements * Fix lint * Some improvements * Fix template variables * Add permission docs * improve doc * Fix fixture * Fix bug * Fix some bug * Fix bug Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Aravinth Manivannan <realaravinth@batsense.net>
* Integration test for migration (#18124)Aravinth Manivannan2022-01-041-0/+104
| | | | | | | | | | | | | | | | integrations: basic test for Gitea {dump,restore}-repo This is a first step for integration testing of DumpRepository and RestoreRepository. It: runs a Gitea server, dumps a repo via DumpRepository to the filesystem, restores the repo via RestoreRepository from the filesystem, dumps the restored repository to the filesystem, compares the first and second dump and expects them to be identical The verification is trivial and the goal is to add more tests for each topic of the dump. Signed-off-by: Loïc Dachary <loic@dachary.org>
* Refactor auth package (#17962)Lunny Xiao2022-01-021-14/+14
|
* Add API to get issue/pull comments and events (timeline) (#17403)qwerty2872022-01-011-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add API to get issue/pull comments and events (timeline) Adds an API to get both comments and events in one endpoint with all required data. Closes go-gitea/gitea#13250 * Fix swagger * Don't show code comments (use review api instead) * fmt * Fix comment * Time -> TrackedTime * Use var directly * Add logger * Fix lint * Fix test * Add comments * fmt * [test] get issue directly by ID * Update test * Add description for changed refs * Fix build issues + lint * Fix build * Use string enums * Update swagger * Support `page` and `limit` params * fmt + swagger * Use global slices Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Handle invalid issues (#18111)Gusted2021-12-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | * Handle invalid issues - When you hover over a issue reference, and the issue doesn't exist, it will just hang on the loading animation. - This patch fixes that by showing them the pop-up with a "Error occured" message. * Add I18N * refactor * fix comment for lint * fix unit test for i18n * fix unit test for i18n * add comments Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Instead of using routerCtx just escape the url before routing (#18086)zeripath2021-12-251-10/+1
| | | | | | | | | | | | | | | | A consequence of forcibly setting the RoutePath to the escaped url is that the auto routing to endpoints without terminal slashes fails (Causing #18060.) This failure raises the possibility that forcibly setting the RoutePath causes other unexpected behaviors too. Therefore, instead we should simply pre-escape the URL in the process registering handler. Then the request URL will be properly escaped for all the following calls. Fix #17938 Fix #18060 Replace #18062 Replace #17997 Signed-off-by: Andrew Thornton <art27@cantab.net>