+2008-01-16 Juraj Skripsky <js@hotfeet.ch>
+
+ * HttpRequest.cs (get_UrlReferrer): Handle case when headers contain
+ invalid Url for referer.
+
+2008-01-16 Juraj Skripsky <js@hotfeet.ch>
+
+ * HttpCookieCollection.cs (AllKeys): Use Keys.CopyTo().
+
2008-01-14 Sebastien Pouliot <sebastien@ximian.com>
* HttpCookie.cs: Fix HttpOnly setter. Found using Gendarme.
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Collections;
using System.Collections.Specialized;
using System.Security.Permissions;
public string[] AllKeys {
get {
- /* XXX another inefficient copy due to
- * lack of exposure from the base
- * class */
string[] keys = new string [Keys.Count];
- for (int i = 0; i < Keys.Count; i ++)
- keys[i] = Keys[i];
-
+ ((ICollection)Keys).CopyTo (keys, 0);
return keys;
}
}
if (hr == null)
return null;
- return new Uri (hr);
+ Uri uri = null;
+ try {
+ uri = new Uri (hr);
+ } catch (UriFormatException) {}
+ return uri;
}
}
+2008-01-16 Juraj Skripsky <js@hotfeet.ch>
+
+ * HttpRequestTest.cs (TestReferer): added test for invalid referer url.
+
2008-01-14 Sebastien Pouliot <sebastien@ximian.com>
* HttpCookieTest.cs: Added HttpOnly test cases.
case 1: return null;
case 2: return "http://www.mono-project.com/test.aspx";
case 15: return "http://www.mono-project.com";
+ case 33: return "x";
}
break;
case HttpWorkerRequest.HeaderUserAgent:
Assert.AreEqual (null, c.Request.UrlReferrer, "REF1");
c = Cook (2);
- Assert.AreEqual ("http://www.mono-project.com/test.aspx", c.Request.UrlReferrer.ToString (), "REF1");
+ Assert.AreEqual ("http://www.mono-project.com/test.aspx", c.Request.UrlReferrer.ToString (), "REF1");
+
+ c = Cook (33);
+ Assert.AreEqual (null, c.Request.UrlReferrer, "REF1");
}