package mongo
|
|
import (
|
"testing"
|
|
"github.com/stretchr/testify/require"
|
"go.mongodb.org/mongo-driver/mongo/options"
|
)
|
|
func TestURIParsingAuth(t *testing.T) {
|
opts := options.Client().ApplyURI("mongodb://localhost:27017")
|
require.Nil(t, opts.Auth)
|
|
opts = options.Client().ApplyURI("mongodb://localhost:27017/test")
|
require.Nil(t, opts.Auth)
|
}
|
the second assertion fails.
I believe the bug is fixed by removing the final conditional (cs.AuthSource != "admin") from line 126 of go.mongodb.org/mongo-driver/mongo/options/clientoptions.go
|