@@ -193,6 +193,9 @@ impl Settings {
193193 }
194194 } ;
195195 }
196+ if let Some ( trust_installation_dir) = query_parameters. get ( "trust_installation_dir" ) {
197+ settings. trust_installation_dir = trust_installation_dir == "true" ;
198+ }
196199 let configuration_prefix = "configuration." ;
197200 for ( key, value) in & query_parameters {
198201 if key. starts_with ( configuration_prefix) {
@@ -299,10 +302,11 @@ mod tests {
299302 let password_file = "password_file=/tmp/.pgpass" ;
300303 let data_dir = "data_dir=/tmp/data" ;
301304 let temporary = "temporary=false" ;
305+ let trust_installation_dir = "trust_installation_dir=true" ;
302306 let timeout = "timeout=10" ;
303307 let configuration = "configuration.max_connections=42" ;
304308 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}"
306310 ) ;
307311
308312 let settings = Settings :: from_url ( url) ?;
@@ -317,6 +321,7 @@ mod tests {
317321 assert_eq ! ( BOOTSTRAP_SUPERUSER , settings. username) ;
318322 assert_eq ! ( "password" , settings. password) ;
319323 assert ! ( !settings. temporary) ;
324+ assert ! ( settings. trust_installation_dir) ;
320325 assert_eq ! ( Some ( Duration :: from_secs( 10 ) ) , settings. timeout) ;
321326 let configuration = HashMap :: from ( [ ( "max_connections" . to_string ( ) , "42" . to_string ( ) ) ] ) ;
322327 assert_eq ! ( configuration, settings. configuration) ;
0 commit comments