File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,7 @@ Test Case in oracle_private/ezconnectTest.js
39
39
const HOSTNAMES_PATTERN = new RegExp ( "((?=(?<hostnames>(((\\[[A-z0-9:]+\\])|([A-z0-9][A-z0-9._-]+))[,]?)+)))\\k<hostnames>(:(?<port>\\d+)?)?" , 'g' ) ;
40
40
41
41
// The EZConnect pattern without the extended settings part.
42
- const EZ_URL_PATTERN = new RegExp ( "^((?<protocol>tcp|tcps):)?"
43
- + "(//)?"
42
+ const EZ_URL_PATTERN = new RegExp ( "^(((?<protocol>[A-z0-9]+):)?//)?"
44
43
+ "(?<hostinfo>(" + HOSTNAMES_PATTERN . source + "(?=([,]|[;]|[/]|[:]|$))([,]|[;])?)+)"
45
44
+ "(/(?<servicename>[A-z0-9][A-z0-9,-.]+)?)"
46
45
+ "?(:(?<servermode>dedicated|shared|pooled))"
@@ -145,6 +144,8 @@ class EZConnectResolver {
145
144
if ( protocol == null ) {
146
145
if ( ! ( url . includes ( "//" ) ) )
147
146
protocol = 'TCP' ;
147
+ } else if ( protocol . toLowerCase ( ) != 'tcp' && protocol . toLowerCase ( ) != 'tcps' ) {
148
+ errors . throwErr ( errors . ERR_INVALID_EZCONNECT_SYNTAX , 'Invalid protocol' , protocol ) ;
148
149
}
149
150
// Try to get the proxy information from URL properties
150
151
const proxyHost = this . urlProps . get ( "HTTPS_PROXY" ) ;
You can’t perform that action at this time.
0 commit comments