Skip to content

Commit

Permalink
Take a copy of UserData without pointer-hacks that get optimised away (
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrks authored Apr 11, 2023
1 parent 255397f commit 3c7eca6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion db/active_replicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,11 @@ func blipSync(target url.URL, blipContext *blip.Context, insecureSkipVerify bool
var basicAuthCreds *url.Userinfo
if target.User != nil {
// take a copy
basicAuthCreds = &*target.User
if password, hasPassword := target.User.Password(); hasPassword {
basicAuthCreds = url.UserPassword(target.User.Username(), password)
} else {
basicAuthCreds = url.User(target.User.Username())
}
target.User = nil
}

Expand Down

0 comments on commit 3c7eca6

Please sign in to comment.