mirror of
https://github.com/actions/toolkit.git
synced 2026-08-19 00:00:17 +02:00
Fix regex to properly escape hyphen in character class
Co-authored-by: TingluoHuang <[email protected]>
This commit is contained in:
co-authored by
TingluoHuang
parent
32c52bb78a
commit
557f80fd03
@@ -822,7 +822,7 @@ export class HttpClient {
|
|||||||
if (orchId) {
|
if (orchId) {
|
||||||
// Sanitize the orchestration ID to ensure it contains only valid token characters
|
// Sanitize the orchestration ID to ensure it contains only valid token characters
|
||||||
// Valid characters: alphanumeric, !, #, $, %, &, ', *, +, -, ., ^, _, `, |, ~
|
// 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} github_orchestration_id/${sanitizedId}`
|
||||||
}
|
}
|
||||||
return userAgent
|
return userAgent
|
||||||
|
|||||||
Reference in New Issue
Block a user