diff options
author | Lauris BH <lauris@nix.lv> | 2017-04-19 06:02:20 +0300 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-04-19 11:02:20 +0800 |
commit | f42ec6120e8a2830407027020b65391ebf8e7f59 (patch) | |
tree | aee67e8f44d105ef957b27fe3777e38aa034baa6 /cmd/web.go | |
parent | 941281ae12f0df84ffc73c279dc9e55f058e4703 (diff) | |
download | gitea-f42ec6120e8a2830407027020b65391ebf8e7f59.tar.gz gitea-f42ec6120e8a2830407027020b65391ebf8e7f59.zip |
Better URL validation (#1507)
* Add correct git branch name validation
* Change git refname validation error constant name
* Implement URL validation based on GoLang url.Parse method
* Backward compatibility with older Go compiler
* Add git reference name validation unit tests
* Remove unused variable in unit test
* Implement URL validation based on GoLang url.Parse method
* Backward compatibility with older Go compiler
* Add url validation unit tests
Diffstat (limited to 'cmd/web.go')
-rw-r--r-- | cmd/web.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd/web.go b/cmd/web.go index b2cc3959a2..411b50d9bf 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -23,6 +23,7 @@ import ( "code.gitea.io/gitea/modules/public" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/templates" + "code.gitea.io/gitea/modules/validation" "code.gitea.io/gitea/routers" "code.gitea.io/gitea/routers/admin" apiv1 "code.gitea.io/gitea/routers/api/v1" @@ -177,6 +178,7 @@ func runWeb(ctx *cli.Context) error { reqSignOut := context.Toggle(&context.ToggleOptions{SignOutRequired: true}) bindIgnErr := binding.BindIgnErr + validation.AddBindingRules() m.Use(user.GetNotificationCount) |