summaryrefslogtreecommitdiffstats
path: root/routers/repo/setting.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-08-16 22:56:57 +0100
committerGitHub <noreply@github.com>2019-08-16 22:56:57 +0100
commitbee1227b2f64d33ecbb0c5972ffc1b7d9689f95f (patch)
tree557dd7a1e9bcac37b9c6e2e36ccc2a298076df1d /routers/repo/setting.go
parent867f46f78e5777d7bafe83cda3244c1001ce3e60 (diff)
downloadgitea-bee1227b2f64d33ecbb0c5972ffc1b7d9689f95f.tar.gz
gitea-bee1227b2f64d33ecbb0c5972ffc1b7d9689f95f.zip
Extract the username and password from the mirror url (#7651)
* Explode out mirror username and password * Update models/repo_mirror.go * Just roundtrip the password * remove unused declaration * Update templates/repo/settings/options.tmpl
Diffstat (limited to 'routers/repo/setting.go')
-rw-r--r--routers/repo/setting.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/repo/setting.go b/routers/repo/setting.go
index c9ecb63020..38c6ecf56e 100644
--- a/routers/repo/setting.go
+++ b/routers/repo/setting.go
@@ -169,6 +169,10 @@ func SettingsPost(ctx *context.Context, form auth.RepoSettingForm) {
return
}
+ if form.MirrorUsername != "" || form.MirrorPassword != "" {
+ u.User = url.UserPassword(form.MirrorUsername, form.MirrorPassword)
+ }
+
// Now use xurls
address := validFormAddress.FindString(form.MirrorAddress)
if address != form.MirrorAddress && form.MirrorAddress != "" {