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 /modules/git/command.go | |
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 'modules/git/command.go')
-rw-r--r-- | modules/git/command.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/git/command.go b/modules/git/command.go index 8199498a2b..5d2e1dd67a 100644 --- a/modules/git/command.go +++ b/modules/git/command.go @@ -154,7 +154,7 @@ func (c *Command) RunWithContext(rc *RunContext) error { args = make([]string, len(c.args)) copy(args, c.args) for _, urlArgIndex := range argSensitiveURLIndexes { - args[urlArgIndex] = util.NewStringURLSanitizer(args[urlArgIndex], true).Replace(args[urlArgIndex]) + args[urlArgIndex] = util.SanitizeCredentialURLs(args[urlArgIndex]) } } desc = fmt.Sprintf("%s %s [repo_path: %s]", c.name, strings.Join(args, " "), rc.Dir) |