Skip to content

Commit 8d974e6

Browse files
committed
fix: http_token auth require a non empty username
1 parent 7904628 commit 8d974e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

git.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,10 @@ func (w *GitWatcher) updateRepo() error {
443443
opts.Auth = publicKeys
444444

445445
case "http_token":
446+
// token auth ignores the username but it cannot be empty
447+
if w.config.HTTPUsername == "" {
448+
w.config.HTTPUsername = "token"
449+
}
446450
opts.Auth = &http.BasicAuth{
447451
Username: w.config.HTTPUsername,
448452
Password: w.config.HTTPToken,

0 commit comments

Comments
 (0)