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:
4
dist/index.js
vendored
4
dist/index.js
vendored
@@ -36325,8 +36325,8 @@ function getUserAgentWithOrchestrationId(userAgent) {
|
||||
if (!orchestrationId) {
|
||||
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