File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,9 @@ export default class Driver {
6969 'The "endpoint" and "database" fields are deprecated. Use "connectionString" instead' ,
7070 ) ;
7171
72- endpoint = settings . endpoint ;
72+ secure = settings . endpoint . startsWith ( 'grpcs://' ) || endpoint . startsWith ( 'https://' ) ;
73+ endpoint = settings . endpoint . replace ( / ^ ( g r p c s ? | h t t p s ? ) : \/ \/ / , '' ) ;
7374 database = settings . database ;
74-
75- secure = endpoint . startsWith ( 'grpcs://' ) || endpoint . startsWith ( 'https://' ) ;
7675 }
7776
7877 if ( settings . connectionString ) {
Original file line number Diff line number Diff line change @@ -14,9 +14,7 @@ type ServiceFactory<T> = {
1414} ;
1515
1616function removeProtocol ( endpoint : string ) {
17- const re = / ^ ( g r p c : \/ \/ | g r p c s : \/ \/ ) ? ( .+ ) / ;
18- const match = re . exec ( endpoint ) as string [ ] ;
19- return match [ 2 ] ;
17+ return endpoint . replace ( / ^ ( g r p c s ? | h t t p s ? ) : \/ \/ / , '' ) ; ;
2018}
2119
2220export class StreamEnd extends Error {
You can’t perform that action at this time.
0 commit comments