From 2063ade162e8c167b5b90f0314ff0a2c1687f1f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=BE=E3=81=BF=E3=82=84=20=E3=82=86=E3=81=86?= =?UTF-8?q?=E3=81=93?= <1@1234.sh> Date: Wed, 4 Nov 2015 10:12:52 +0800 Subject: [PATCH] We have used to `if (Cookies["xxx"] == null)` We have used to `if (Cookies["xxx"] == null)` to detect the key exist or not. The String.Empty will equals to "", We have to use Cookies.Keys.Contains("xxx") it's so complex. --- src/Microsoft.AspNet.Http/RequestCookieCollection.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNet.Http/RequestCookieCollection.cs b/src/Microsoft.AspNet.Http/RequestCookieCollection.cs index 363b69df..4337ce44 100644 --- a/src/Microsoft.AspNet.Http/RequestCookieCollection.cs +++ b/src/Microsoft.AspNet.Http/RequestCookieCollection.cs @@ -48,7 +48,7 @@ public string this[string key] if (Store == null) { - return string.Empty; + return null; } string value; @@ -56,7 +56,7 @@ public string this[string key] { return value; } - return string.Empty; + return null; } } @@ -232,4 +232,4 @@ public void Reset() } } } -} \ No newline at end of file +}