Skip to content

Commit 22be937

Browse files
authored
fix(sagemaker): rearrange order for double unescape (#8355)
## Problem - replacement may produce '&' characters that are double-unescaped ## Solution - change the order of the .replace() calls in the decoding of both wsUrl and token such that & is decoded after all other HTML entities have been decoded - Addressing bot suggestion in #8341 --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 83a118e commit 22be937

File tree

1 file changed

+6
-6
lines changed
  • packages/core/src/awsService/sagemaker

1 file changed

+6
-6
lines changed

packages/core/src/awsService/sagemaker/model.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,14 @@ export async function prepareDevEnvConnection(
174174
const logFileLocation = path.join(ctx.globalStorageUri.fsPath, 'hyperpod-connection.log')
175175
const decodedWsUrl =
176176
wsUrl
177-
?.replace(/&/g, '&')
178-
.replace(/'/g, "'")
179-
.replace(/"/g, '"') || ''
177+
?.replace(/'/g, "'")
178+
.replace(/"/g, '"')
179+
.replace(/&/g, '&') || ''
180180
const decodedToken =
181181
token
182-
?.replace(/&/g, '&')
183-
.replace(/'/g, "'")
184-
.replace(/"/g, '"') || ''
182+
?.replace(/'/g, "'")
183+
.replace(/"/g, '"')
184+
.replace(/&/g, '&') || ''
185185
const region = decodedWsUrl ? extractRegionFromStreamUrl(decodedWsUrl) : ''
186186

187187
const hyperPodEnv: NodeJS.ProcessEnv = {

0 commit comments

Comments
 (0)