@@ -193,6 +193,9 @@ impl Settings {
193
193
}
194
194
} ;
195
195
}
196
+ if let Some ( trust_installation_dir) = query_parameters. get ( "trust_installation_dir" ) {
197
+ settings. trust_installation_dir = trust_installation_dir == "true" ;
198
+ }
196
199
let configuration_prefix = "configuration." ;
197
200
for ( key, value) in & query_parameters {
198
201
if key. starts_with ( configuration_prefix) {
@@ -299,10 +302,11 @@ mod tests {
299
302
let password_file = "password_file=/tmp/.pgpass" ;
300
303
let data_dir = "data_dir=/tmp/data" ;
301
304
let temporary = "temporary=false" ;
305
+ let trust_installation_dir = "trust_installation_dir=true" ;
302
306
let timeout = "timeout=10" ;
303
307
let configuration = "configuration.max_connections=42" ;
304
308
let url = format ! (
305
- "{base_url}?{releases_url}&{version}&{installation_dir}&{password_file}&{data_dir}&{temporary}&{temporary }&{timeout}&{configuration}"
309
+ "{base_url}?{releases_url}&{version}&{installation_dir}&{password_file}&{data_dir}&{temporary}&{trust_installation_dir }&{timeout}&{configuration}"
306
310
) ;
307
311
308
312
let settings = Settings :: from_url ( url) ?;
@@ -317,6 +321,7 @@ mod tests {
317
321
assert_eq ! ( BOOTSTRAP_SUPERUSER , settings. username) ;
318
322
assert_eq ! ( "password" , settings. password) ;
319
323
assert ! ( !settings. temporary) ;
324
+ assert ! ( settings. trust_installation_dir) ;
320
325
assert_eq ! ( Some ( Duration :: from_secs( 10 ) ) , settings. timeout) ;
321
326
let configuration = HashMap :: from ( [ ( "max_connections" . to_string ( ) , "42" . to_string ( ) ) ] ) ;
322
327
assert_eq ! ( configuration, settings. configuration) ;
0 commit comments