Skip to content

Commit 39549c8

Browse files
author
Elad Zelingher
committed
Fixing CookieProvider
1 parent 70f4b05 commit 39549c8

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/net45/Extensions/WampSharp.AspNet.WebSockets.Server/AspNetCookieProvider.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System.Collections.Generic;
2-
using System.Net;
1+
using System.Net;
32
using System.Web;
43
using WampSharp.V2.Authentication;
54

@@ -16,13 +15,9 @@ private static CookieCollection GetCookieCollection(HttpContext httpContext)
1615
{
1716
CookieCollection result = new CookieCollection();
1817

19-
foreach (var cookie in httpContext.Request.Cookies)
18+
foreach (HttpCookie cookie in httpContext.Request.Cookies)
2019
{
21-
if (cookie is KeyValuePair<string, string>)
22-
{
23-
var castedCookie = (KeyValuePair<string, string>) cookie;
24-
result.Add(new Cookie(castedCookie.Key, castedCookie.Value));
25-
}
20+
result.Add(new Cookie(cookie.Name, cookie.Value));
2621
}
2722

2823
return result;

0 commit comments

Comments
 (0)