X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=blobdiff_plain;f=mcs%2Fclass%2FSystem%2FSystem.Net%2FHttpListenerRequest.cs;h=e351807aa3befe092968fe95930f0c1820320e00;hp=2a690b0e3b2519630622fb0e815026af226ab65b;hb=e3685c4c9aad38851097cff877dc0fb7ed47ab10;hpb=a17ae9ec7447555f1331b4831573ce66ffb01259 diff --git a/mcs/class/System/System.Net/HttpListenerRequest.cs b/mcs/class/System/System.Net/HttpListenerRequest.cs index 2a690b0e3b2..e351807aa3b 100644 --- a/mcs/class/System/System.Net/HttpListenerRequest.cs +++ b/mcs/class/System/System.Net/HttpListenerRequest.cs @@ -330,16 +330,20 @@ namespace System.Net { if (current != null) { cookies.Add (current); } - current = new Cookie (); - int idx = str.IndexOf ('='); - if (idx > 0) { - current.Name = str.Substring (0, idx).Trim (); - current.Value = str.Substring (idx + 1).Trim (); - } else { - current.Name = str.Trim (); - current.Value = String.Empty; + try { + current = new Cookie (); + int idx = str.IndexOf ('='); + if (idx > 0) { + current.Name = str.Substring (0, idx).Trim (); + current.Value = str.Substring (idx + 1).Trim (); + } else { + current.Name = str.Trim (); + current.Value = String.Empty; + } + current.Version = version; + } catch (CookieException) { + current = null; } - current.Version = version; } } if (current != null) {