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
3939const HOSTNAMES_PATTERN = new RegExp ( "((?=(?<hostnames>(((\\[[A-z0-9:]+\\])|([A-z0-9][A-z0-9._-]+))[,]?)+)))\\k<hostnames>(:(?<port>\\d+)?)?" , 'g' ) ;
4040
4141// 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]+):)?//)?"
4443 + "(?<hostinfo>(" + HOSTNAMES_PATTERN . source + "(?=([,]|[;]|[/]|[:]|$))([,]|[;])?)+)"
4544 + "(/(?<servicename>[A-z0-9][A-z0-9,-.]+)?)"
4645 + "?(:(?<servermode>dedicated|shared|pooled))"
@@ -145,6 +144,8 @@ class EZConnectResolver {
145144 if ( protocol == null ) {
146145 if ( ! ( url . includes ( "//" ) ) )
147146 protocol = 'TCP' ;
147+ } else if ( protocol . toLowerCase ( ) != 'tcp' && protocol . toLowerCase ( ) != 'tcps' ) {
148+ errors . throwErr ( errors . ERR_INVALID_EZCONNECT_SYNTAX , 'Invalid protocol' , protocol ) ;
148149 }
149150 // Try to get the proxy information from URL properties
150151 const proxyHost = this . urlProps . get ( "HTTPS_PROXY" ) ;
You can’t perform that action at this time.
0 commit comments