Add pid to user-agent and session owner. (#3432)

This commit is contained in:
Tingluo Huang
2024-08-16 15:17:13 -04:00
committed by GitHub
parent a77fe8a53f
commit 2979fbad94
4 changed files with 9 additions and 3 deletions

View File

@@ -244,6 +244,10 @@ namespace GitHub.Runner.Common
_trace.Info($"Adding extra user agent '{extraUserAgentHeader}' to all HTTP requests.");
_userAgents.Add(extraUserAgentHeader);
}
var currentProcess = Process.GetCurrentProcess();
_userAgents.Add(new ProductInfoHeaderValue("Pid", currentProcess.Id.ToString()));
_userAgents.Add(new ProductInfoHeaderValue("CreationTime", Uri.EscapeDataString(DateTime.UtcNow.ToString("O"))));
}
public string GetDirectory(WellKnownDirectory directory)