Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion generate/templates/Configuration.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ namespace {{packageName}}.Client
public string BuildUserAgent()
{
StringBuilder sb = new StringBuilder("vault-client-dotnet/");
string OSName = RuntimeInformation.OSDescription.Substring(0, RuntimeInformation.OSDescription.IndexOf(" "));
string OSName = RuntimeInformation.OSDescription.Contains(" ") ? RuntimeInformation.OSDescription.Substring(0, RuntimeInformation.OSDescription.IndexOf(" ")) : RuntimeInformation.OSDescription;
sb.AppendFormat("{0} ({1} {2}; .Net {3})", Version, OSName, RuntimeInformation.ProcessArchitecture, System.Environment.Version);
return sb.ToString();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Vault/Client/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public string GetApiKeyWithPrefix(string apiKeyIdentifier)
public string BuildUserAgent()
{
StringBuilder sb = new StringBuilder("vault-client-dotnet/");
string OSName = RuntimeInformation.OSDescription.Substring(0, RuntimeInformation.OSDescription.IndexOf(" "));
string OSName = RuntimeInformation.OSDescription.Contains(" ") ? RuntimeInformation.OSDescription.Substring(0, RuntimeInformation.OSDescription.IndexOf(" ")) : RuntimeInformation.OSDescription;
sb.AppendFormat("{0} ({1} {2}; .Net {3})", Version, OSName, RuntimeInformation.ProcessArchitecture, System.Environment.Version);
return sb.ToString();
}
Expand Down