summaryrefslogtreecommitdiffstats
path: root/modules/util/sanitize.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-25 18:57:43 +0800
committerzeripath <art27@cantab.net>2020-01-25 10:57:42 +0000
commita67c06ce90fb3bea97987501377e4dc5f24d2151 (patch)
tree40de3d2b2de625f44529859ec4fc642ab8d31f21 /modules/util/sanitize.go
parent5b17bb8f3dbc180c72446000d82ba06fd7349dc7 (diff)
downloadgitea-a67c06ce90fb3bea97987501377e4dc5f24d2151.tar.gz
gitea-a67c06ce90fb3bea97987501377e4dc5f24d2151.zip
Sanitize credentials in mirror form (#9975)
Diffstat (limited to 'modules/util/sanitize.go')
-rw-r--r--modules/util/sanitize.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/util/sanitize.go b/modules/util/sanitize.go
index b1c17b29cf..d04e1dee77 100644
--- a/modules/util/sanitize.go
+++ b/modules/util/sanitize.go
@@ -7,6 +7,8 @@ package util
import (
"net/url"
"strings"
+
+ "code.gitea.io/gitea/modules/log"
)
// urlSafeError wraps an error whose message may contain a sensitive URL
@@ -36,6 +38,7 @@ func SanitizeMessage(message, unsanitizedURL string) string {
func SanitizeURLCredentials(unsanitizedURL string, usePlaceholder bool) string {
u, err := url.Parse(unsanitizedURL)
if err != nil {
+ log.Error("parse url %s failed: %v", unsanitizedURL, err)
// don't log the error, since it might contain unsanitized URL.
return "(unparsable url)"
}