summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/migrate.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-03-31 10:25:40 +0800
committerGitHub <noreply@github.com>2022-03-31 10:25:40 +0800
commitc83168104b8bcb09e3e6e1490bd586a9e1a55bc3 (patch)
tree6732a64a1f40d9c27f3a3215bc847e701367e777 /routers/web/repo/migrate.go
parent84038f33f42b03dbf455e41f5036f67ba7b61a66 (diff)
downloadgitea-c83168104b8bcb09e3e6e1490bd586a9e1a55bc3.tar.gz
gitea-c83168104b8bcb09e3e6e1490bd586a9e1a55bc3.zip
Use a more general (and faster) method to sanitize URLs with credentials (#19239)
Use a more general method to sanitize URLs with credentials: Simple and intuitive / Faster / Remove all credentials in all URLs
Diffstat (limited to 'routers/web/repo/migrate.go')
-rw-r--r--routers/web/repo/migrate.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/routers/web/repo/migrate.go b/routers/web/repo/migrate.go
index 5845e7e5d3..38cdbd4973 100644
--- a/routers/web/repo/migrate.go
+++ b/routers/web/repo/migrate.go
@@ -106,8 +106,7 @@ func handleMigrateError(ctx *context.Context, owner *user_model.User, err error,
ctx.Data["Err_RepoName"] = true
ctx.RenderWithErr(ctx.Tr("repo.form.name_pattern_not_allowed", err.(db.ErrNamePatternNotAllowed).Pattern), tpl, form)
default:
- remoteAddr, _ := forms.ParseRemoteAddr(form.CloneAddr, form.AuthUsername, form.AuthPassword)
- err = util.NewStringURLSanitizedError(err, remoteAddr, true)
+ err = util.SanitizeErrorCredentialURLs(err)
if strings.Contains(err.Error(), "Authentication failed") ||
strings.Contains(err.Error(), "Bad credentials") ||
strings.Contains(err.Error(), "could not read Username") {