File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1051,4 +1051,10 @@ mod tests {
1051
1051
1052
1052
assert_eq ! ( 1 , 1 ) ;
1053
1053
}
1054
+
1055
+ #[ test]
1056
+ fn test_invalid_hostaddr_parsing ( ) {
1057
+ let s = "user=pass_user dbname=postgres host=host1 hostaddr=127.0.0 port=26257" ;
1058
+ s. parse :: < Config > ( ) . err ( ) . unwrap ( ) ;
1059
+ }
1054
1060
}
Original file line number Diff line number Diff line change 55
55
// if it's not present, use the value of hostaddr.
56
56
let hostname = match host {
57
57
Some ( Host :: Tcp ( host) ) => host. clone ( ) ,
58
- // postgres doesn't support TLS over unix sockets, so the choice here doesn't matter Some()
58
+ // postgres doesn't support TLS over unix sockets, so the choice here doesn't matter
59
59
#[ cfg( unix) ]
60
60
Some ( Host :: Unix ( _) ) => "" . to_string ( ) ,
61
61
None => hostaddr. map_or ( "" . to_string ( ) , |ipaddr| ipaddr. to_string ( ) ) ,
You can’t perform that action at this time.
0 commit comments