Skip to content

Commit

Permalink
chore: If url is +srv no port is allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
joda01 authored Oct 15, 2024
1 parent 7b590a2 commit a6a7f6c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backends/mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@ func NewMongo(authOpts map[string]string, logLevel log.Level, hasher hashing.Has
m.insecureSkipVerify = true
}

addr := fmt.Sprintf("%s://%s:%s", m.HostPrefix, m.Host, m.Port)
var addr = ""
if m.HostPrefix != "mongodb+srv" {
addr = fmt.Sprintf("%s://%s:%s", m.HostPrefix, m.Host, m.Port)
} else {
addr = fmt.Sprintf("%s://%s", m.HostPrefix, m.Host)
}

to := 60 * time.Second

Expand Down

0 comments on commit a6a7f6c

Please sign in to comment.