File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
redisinsight/api/src/utils Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { HostingProvider } from 'src/modules/core/models/database-instance.entity' ;
2
2
import { IP_ADDRESS_REGEX , PRIVATE_IP_ADDRESS_REGEX } from 'src/constants' ;
3
3
4
+ // Ignore LGTM [js/incomplete-url-substring-sanitization] alert.
5
+ // Because we do not bind potentially dangerous logic to this.
6
+ // We define a hosting provider for telemetry only.
4
7
export const getHostingProvider = ( host : string ) : HostingProvider => {
5
8
// Tries to detect the hosting provider from the hostname.
6
9
if ( host === '0.0.0.0' || host === 'localhost' ) {
@@ -9,12 +12,13 @@ export const getHostingProvider = (host: string): HostingProvider => {
9
12
if ( IP_ADDRESS_REGEX . test ( host ) && PRIVATE_IP_ADDRESS_REGEX . test ( host ) ) {
10
13
return HostingProvider . LOCALHOST ;
11
14
}
12
- if ( host . endsWith ( 'rlrcp.com' ) || host . endsWith ( 'redislabs.com' ) ) {
15
+ if ( host . endsWith ( 'rlrcp.com' ) || host . endsWith ( 'redislabs.com' ) ) { // lgtm[js/incomplete-url-substring-sanitization]
13
16
return HostingProvider . RE_CLOUD ;
14
17
}
15
- if ( host . endsWith ( 'cache.amazonaws.com' ) ) {
18
+ if ( host . endsWith ( 'cache.amazonaws.com' ) ) { // lgtm[js/incomplete-url-substring-sanitization]
16
19
return HostingProvider . AWS ;
17
20
}
21
+ // lgtm[js/incomplete-url-substring-sanitization]
18
22
if ( host . endsWith ( 'cache.windows.net' ) ) {
19
23
return HostingProvider . AZURE ;
20
24
}
You can’t perform that action at this time.
0 commit comments