New test.
[mono.git] / mcs / class / System.Web / System.Web / HttpCacheVaryByParams.cs
index a422e781cb40dc49e40bc799cd0cbe1c5819a5f1..0eabbed64cbc8d0ef6dff083cea2f3147e49f6f0 100644 (file)
 //
 
 using System.Collections;
+using System.Security.Permissions;
 using System.Text;
 
 namespace System.Web {
 
+       // CAS - no InheritanceDemand here as the class is sealed
+       [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
        public sealed class HttpCacheVaryByParams {
 
                bool ignore_parms;
@@ -41,8 +44,12 @@ namespace System.Web {
                internal HttpCacheVaryByParams ()
                {
                        /* the parameter names are meant to be case insensitive */
+#if NET_2_0
+                       parms = new Hashtable (StringComparer.InvariantCultureIgnoreCase);
+#else
                        parms = new Hashtable(CaseInsensitiveHashCodeProvider.Default,
                                              CaseInsensitiveComparer.Default);
+#endif
                }
 
                internal string[] GetParamNames ()
@@ -65,6 +72,9 @@ namespace System.Web {
                                builder.Append ("; ");
                        }
 
+                       if (builder.Length == 0)
+                               return null;
+
                        return new UnknownResponseHeader ("Vary", builder.ToString());
                }