From 646db723bd364df3925f80dcd30a58f312fedd8e Mon Sep 17 00:00:00 2001 From: Andre Wanlin Date: Fri, 8 Dec 2023 12:56:58 -0600 Subject: [PATCH] Updated to use `encodeURIComponent` Signed-off-by: Andre Wanlin --- .changeset/plenty-plums-talk.md | 5 +++++ plugins/azure-devops-backend/src/api/AzureDevOpsApi.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/plenty-plums-talk.md diff --git a/.changeset/plenty-plums-talk.md b/.changeset/plenty-plums-talk.md new file mode 100644 index 0000000000..fe971d0476 --- /dev/null +++ b/.changeset/plenty-plums-talk.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-azure-devops-backend': patch +--- + +Updated encoding of Org to use `encodeURIComponent` when building URL used to get credentials from credential provider diff --git a/plugins/azure-devops-backend/src/api/AzureDevOpsApi.ts b/plugins/azure-devops-backend/src/api/AzureDevOpsApi.ts index 3900882940..d50888006b 100644 --- a/plugins/azure-devops-backend/src/api/AzureDevOpsApi.ts +++ b/plugins/azure-devops-backend/src/api/AzureDevOpsApi.ts @@ -110,7 +110,7 @@ export class AzureDevOpsApi { // which is why use them here and not just falling back on them entirely const validHost = host ?? this.config.getString('azureDevOps.host'); const validOrg = org ?? this.config.getString('azureDevOps.organization'); - const url = `https://${validHost}/${encodeURI(validOrg)}`; + const url = `https://${validHost}/${encodeURIComponent(validOrg)}`; const credentials = await this.credentialsProvider.getCredentials({ url,