Update isCloud method to resolve Incomplete URL substring sanitization error
Signed-off-by: Camgoz, Fatih <fatih.camgoz@rbc.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user