Skip to content

Commit

Permalink
fix: http_token auth require a non empty username
Browse files Browse the repository at this point in the history
  • Loading branch information
Matrix86 committed Mar 23, 2021
1 parent 7904628 commit 8d974e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions git.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,10 @@ func (w *GitWatcher) updateRepo() error {
opts.Auth = publicKeys

case "http_token":
// token auth ignores the username but it cannot be empty
if w.config.HTTPUsername == "" {
w.config.HTTPUsername = "token"
}
opts.Auth = &http.BasicAuth{
Username: w.config.HTTPUsername,
Password: w.config.HTTPToken,
Expand Down

0 comments on commit 8d974e6

Please sign in to comment.