mirror of
https://github.com/actions/github-script.git
synced 2026-02-09 03:45:24 +00:00
Replace invalid characters with underscore instead of removing them
Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
This commit is contained in:
@@ -111,8 +111,8 @@ function getUserAgentWithOrchestrationId(userAgent: string): string {
|
||||
return userAgent
|
||||
}
|
||||
|
||||
// Sanitize orchestration ID - only keep alphanumeric, dots, hyphens, and underscores
|
||||
const sanitized = orchestrationId.replace(/[^a-zA-Z0-9._-]/g, '')
|
||||
// Sanitize orchestration ID - replace invalid characters with underscore
|
||||
const sanitized = orchestrationId.replace(/[^a-zA-Z0-9._-]/g, '_')
|
||||
if (!sanitized) {
|
||||
return userAgent
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user