Update isCloud method to resolve Incomplete URL substring sanitization error

Signed-off-by: Camgoz, Fatih <fatih.camgoz@rbc.com>
This commit is contained in:
Camgoz, Fatih
2025-05-16 13:39:50 -04:00
parent be82d839d4
commit f8df253261
2 changed files with 25 additions and 5 deletions
+13 -3
View File
@@ -2,9 +2,19 @@
'@backstage/plugin-catalog-backend-module-azure': minor
---
isCloud function now also checks if hostname endswith visualstudio.com along with dev.azure.com
isCloud function now also checks if hostname is visualstudio.com or endswith visualstudio.com along with dev.azure.com
git s
```diff
- const isCloud = (host: string) => host === 'dev.azure.com';
+ const isCloud = (host: string) => host === 'dev.azure.com' || host.endsWith('visualstudio.com');
+ const isCloud = (host: string) => {
+ if (host === 'dev.azure.com') {
+ return true;
+ }
+ if (host === 'visualstudio.com' || host.endsWith('.visualstudio.com')) {
+ return true;
+ }
+ return false;
+ };
```
@@ -46,8 +46,18 @@ interface CodeSearchRequest {
};
}
const isCloud = (host: string) =>
host === 'dev.azure.com' || host.endsWith('visualstudio.com');
const isCloud = (host: string) => {
if (host === 'dev.azure.com') {
return true;
}
if (host === 'visualstudio.com' || host.endsWith('.visualstudio.com')) {
return true;
}
return false;
};
const PAGE_SIZE = 1000;
// codeSearch returns all files that matches the given search path.