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 {
69
69
'The "endpoint" and "database" fields are deprecated. Use "connectionString" instead' ,
70
70
) ;
71
71
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 ? ) : \/ \/ / , '' ) ;
73
74
database = settings . database ;
74
-
75
- secure = endpoint . startsWith ( 'grpcs://' ) || endpoint . startsWith ( 'https://' ) ;
76
75
}
77
76
78
77
if ( settings . connectionString ) {
Original file line number Diff line number Diff line change @@ -14,9 +14,7 @@ type ServiceFactory<T> = {
14
14
} ;
15
15
16
16
function 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 ? ) : \/ \/ / , '' ) ; ;
20
18
}
21
19
22
20
export class StreamEnd extends Error {
You can’t perform that action at this time.
0 commit comments