@@ -114,6 +114,7 @@ defmodule Mongo.UrlParser do
114
114
115
115
116
116
defp parse_query_options ( opts , % { "options" => options } ) when is_binary ( options ) do
117
+ IO . puts ( "#{ inspect ( opts ) } --- #{ inspect ( options ) } " )
117
118
options
118
119
|> String . split ( "&" )
119
120
|> Enum . map ( fn option -> String . split ( option , "=" ) end )
@@ -128,7 +129,7 @@ defmodule Mongo.UrlParser do
128
129
129
130
defp parse_seeds ( opts , _frags ) , do: opts
130
131
131
- defp resolve_srv_url ( % { "seeds" => url , "srv" => srv } = frags )
132
+ defp resolve_srv_url ( % { "seeds" => url , "srv" => srv , "options" => orig_options } = frags )
132
133
when is_bitstring ( url ) and srv == "+srv" do
133
134
# Fix for windows only
134
135
with { :win32 , _ } <- :os . type ( ) do
@@ -137,10 +138,10 @@ defmodule Mongo.UrlParser do
137
138
138
139
with url_char <- String . to_charlist ( url ) ,
139
140
{ :ok , { _ , _ , _ , _ , _ , srv_record } } <-
140
- :inet_res . getbyname ( '_mongodb._tcp.' ++ url_char , :srv ) ,
141
+ :inet_res . getbyname ( '_mongodb._tcp.' ++ url_char , :srv ) ,
141
142
{ :ok , host } <- get_host_srv ( srv_record ) ,
142
143
{ :ok , { _ , _ , _ , _ , _ , txt_record } } <- :inet_res . getbyname ( url_char , :txt ) ,
143
- txt <- "#{ txt_record } &ssl=true" do
144
+ txt <- "#{ orig_options } & #{ txt_record } &ssl=true" do
144
145
frags
145
146
|> Map . put ( "seeds" , host )
146
147
|> Map . put ( "options" , txt )
0 commit comments