@@ -3,22 +3,22 @@ import SdkKeyDecoder from './sdk-key-decoder';
3
3
describe ( 'SdkKeyDecoder' , ( ) => {
4
4
const decoder = new SdkKeyDecoder ( ) ;
5
5
it ( 'should decode the event ingestion hostname from the SDK key' , ( ) => {
6
- const hostname = decoder . decodeEventIngestionHostName (
6
+ const hostname = decoder . decodeEventIngestionUrl (
7
7
'zCsQuoHJxVPp895.ZWg9MTIzNDU2LmUudGVzdGluZy5lcHBvLmNsb3Vk' ,
8
8
) ;
9
- expect ( hostname ) . toEqual ( '123456.e.testing.eppo.cloud' ) ;
9
+ expect ( hostname ) . toEqual ( 'https:// 123456.e.testing.eppo.cloud' ) ;
10
10
} ) ;
11
11
12
12
it ( 'should decode strings with non URL-safe characters' , ( ) => {
13
13
// this is not a really valid ingestion URL, but it's useful for testing the decoder
14
14
const invalidUrl = 'eh=12+3456/.e.testing.eppo.cloud' ;
15
15
const encoded = Buffer . from ( invalidUrl ) . toString ( 'base64url' ) ;
16
- const hostname = decoder . decodeEventIngestionHostName ( `zCsQuoHJxVPp895.${ encoded } ` ) ;
17
- expect ( hostname ) . toEqual ( '12 3456/.e.testing.eppo.cloud' ) ;
16
+ const hostname = decoder . decodeEventIngestionUrl ( `zCsQuoHJxVPp895.${ encoded } ` ) ;
17
+ expect ( hostname ) . toEqual ( 'https:// 12 3456/.e.testing.eppo.cloud' ) ;
18
18
} ) ;
19
19
20
20
it ( "should return null if the SDK key doesn't contain the event ingestion hostname" , ( ) => {
21
- expect ( decoder . decodeEventIngestionHostName ( 'zCsQuoHJxVPp895' ) ) . toBeNull ( ) ;
22
- expect ( decoder . decodeEventIngestionHostName ( 'zCsQuoHJxVPp895.xxxxxx' ) ) . toBeNull ( ) ;
21
+ expect ( decoder . decodeEventIngestionUrl ( 'zCsQuoHJxVPp895' ) ) . toBeNull ( ) ;
22
+ expect ( decoder . decodeEventIngestionUrl ( 'zCsQuoHJxVPp895.xxxxxx' ) ) . toBeNull ( ) ;
23
23
} ) ;
24
24
} ) ;
0 commit comments