File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
ocaml/sdk-gen/csharp/autogen/src Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,15 @@ 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 DefaultUserAgent => $ "XenAPI/{ Helper . APIVersionString ( API_Version . LATEST ) } ";
52+
53+ private static string _userAgent = null ;
54+
55+ public static string UserAgent
56+ {
57+ get => _userAgent ?? DefaultUserAgent ;
58+ set => _userAgent = value ;
59+ }
5260
5361 /// <summary>
5462 /// If null, no proxy is used, otherwise this proxy is used for each request.
@@ -65,7 +73,7 @@ public Session(JsonRpcClient client)
6573 {
6674 client . Timeout = STANDARD_TIMEOUT ;
6775 client . KeepAlive = true ;
68- client . UserAgent = UserAgent ;
76+ UserAgent = ! string . IsNullOrEmpty ( client . UserAgent ) ? client . UserAgent : UserAgent ;
6977 client . WebProxy = Proxy ;
7078 client . AllowAutoRedirect = true ;
7179 JsonRpcClient = client ;
You can’t perform that action at this time.
0 commit comments