Skip to content

Commit b465e9e

Browse files
authored
Use Postgres default port for URLs (vapor#183)
1 parent 8f6d4fa commit b465e9e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Sources/PostgresKit/PostgresConfiguration.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ public struct PostgresConfiguration {
2525
guard let hostname = url.host else {
2626
return nil
2727
}
28-
guard let port = url.port else {
29-
return nil
30-
}
28+
let port = url.port ?? 5432
3129

3230
let tlsConfiguration: TLSConfiguration?
3331
if url.query?.contains("ssl=true") == true || url.query?.contains("sslmode=require") == true {

0 commit comments

Comments
 (0)