Skip to content

Commit 709dae2

Browse files
committed
xenapi: removed the default value for xenserver UserAgent
Signed-off-by: Rashmi A Badadale <[email protected]>
1 parent 654cef3 commit 709dae2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ocaml/sdk-gen/csharp/autogen/src/Session.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public partial class Session : XenObject<Session>
4848
/// <summary>
4949
/// This string is used as the HTTP UserAgent for each request.
5050
/// </summary>
51-
public static string UserAgent = $"XenAPI/{Helper.APIVersionString(API_Version.LATEST)}";
51+
public static string UserAgent => $"XenAPI/{Helper.APIVersionString(API_Version.LATEST)}";
5252

5353
/// <summary>
5454
/// If null, no proxy is used, otherwise this proxy is used for each request.
@@ -65,7 +65,8 @@ public Session(JsonRpcClient client)
6565
{
6666
client.Timeout = STANDARD_TIMEOUT;
6767
client.KeepAlive = true;
68-
client.UserAgent = UserAgent;
68+
if (string.IsNullOrEmpty(client.UserAgent))
69+
client.UserAgent = UserAgent;
6970
client.WebProxy = Proxy;
7071
client.AllowAutoRedirect = true;
7172
JsonRpcClient = client;

0 commit comments

Comments
 (0)