diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-03-31 10:25:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 10:25:40 +0800 |
commit | c83168104b8bcb09e3e6e1490bd586a9e1a55bc3 (patch) | |
tree | 6732a64a1f40d9c27f3a3215bc847e701367e777 /routers/api/v1/repo | |
parent | 84038f33f42b03dbf455e41f5036f67ba7b61a66 (diff) | |
download | gitea-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/api/v1/repo')
-rw-r--r-- | routers/api/v1/repo/migrate.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/repo/migrate.go b/routers/api/v1/repo/migrate.go index 1adf5bbe86..d2c2d8ba14 100644 --- a/routers/api/v1/repo/migrate.go +++ b/routers/api/v1/repo/migrate.go @@ -236,7 +236,7 @@ func handleMigrateError(ctx *context.APIContext, repoOwner *user_model.User, rem case base.IsErrNotSupported(err): ctx.Error(http.StatusUnprocessableEntity, "", err) default: - 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") { |