ソースを参照

[System.Net.Http] Fix CFNetworkHandler.CookieContainer not to return null (#3141)

* [System.Net.Http] Fix CFNetworkHandler.CookieContainer not to return null

This aligns the handler with the managed HttpClientHandler [1] and make
it easier to switch between them without additional or conditional code.

[1] https://github.com/mono/mono/blob/14f8acced5bbb2f6d55fb3e7800382700bcc65eb/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs#L97
Sebastien Pouliot 9 年 前
コミット
999ed78aa7
1 ファイル変更1 行追加1 行削除
  1. 1 1
      mcs/class/System.Net.Http/CFNetworkHandler.cs

+ 1 - 1
mcs/class/System.Net.Http/CFNetworkHandler.cs

@@ -100,7 +100,7 @@ namespace System.Net.Http
 
 		public CookieContainer CookieContainer {
 			get {
-				return cookies;
+				return cookies ?? (cookies = new CookieContainer ());
 			}
 			set {
 				EnsureModifiability ();