File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ exports._queryWithConnectionString = async function(query, connectionString) {
14
14
}
15
15
16
16
function encodePasswordInConnectionString ( connectionString ) {
17
- const regex = / ^ ( p o s t g r e s q l : \/ \/ ) ( [ ^ : ] + ) : ( [ ^ @ ] + ) @ ( [ ^ : \/ ] + ) : ( \d + ) \/ ( .+ ) $ / ;
17
+ const regex = / ^ ( p o s t g r e s q l : \/ \/ ) ( [ ^ : ] + ) : ( [ ^ @ ] + ) @ ( [ ^ : \/ ] + ) ( : \d + ) ? \/ ( .+ ) $ / ;
18
18
const match = connectionString . match ( regex ) ;
19
19
20
20
if ( ! match ) {
@@ -25,7 +25,7 @@ function encodePasswordInConnectionString(connectionString) {
25
25
26
26
const encodedPassword = encodeURIComponent ( password ) ;
27
27
28
- return `${ protocol } ${ username } :${ encodedPassword } @${ host } : ${ port } /${ database } ` ;
28
+ return `${ protocol } ${ username } :${ encodedPassword } @${ host } ${ port ?? "" } /${ database } ` ;
29
29
}
30
30
31
31
// workaround for readiness probe
You can’t perform that action at this time.
0 commit comments