Fix regex to properly escape hyphen in character class

Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-06 16:28:52 +00:00
parent 32c52bb78a
commit 557f80fd03
+1 -1
View File
@@ -822,7 +822,7 @@ export class HttpClient {
if (orchId) {
// Sanitize the orchestration ID to ensure it contains only valid token characters
// Valid characters: alphanumeric, !, #, $, %, &, ', *, +, -, ., ^, _, `, |, ~
const sanitizedId = orchId.replace(/[^a-zA-Z0-9!#$%&'*+\-.^_`|~]/g, '_')
const sanitizedId = orchId.replace(/[^a-zA-Z0-9!#$%&'*+.\-^_`|~]/g, '_')
return `${userAgent} github_orchestration_id/${sanitizedId}`
}
return userAgent