Merge pull request #2530 from lambdageek/monoerror-mono_string_new
[mono.git] / mcs / class / System.Web / System.Web / HttpCacheVaryByHeaders.cs
index 0a4d5c7487c4d1931934146ef6ff71a9ffde18b8..ecac270be4f55dbef8e313bdd6c10eaacb61e8c5 100644 (file)
@@ -6,7 +6,7 @@
 //
 
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 using System.Collections;
 using System.Security.Permissions;
 
-namespace System.Web {
-
+namespace System.Web
+{
        // CAS - no InheritanceDemand here as the class is sealed
        [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-       public sealed class HttpCacheVaryByHeaders {
-
+       public sealed class HttpCacheVaryByHeaders
+       {
                /* I would have much rather seen this class just use the
                 * Hashtable, and have the getter/setters for the builtin
                 * fields just manipulate that Hashtable, but that doesn't
@@ -66,22 +66,18 @@ namespace System.Web {
 
                Hashtable fields;
 
-               internal HttpCacheVaryByHeaders ()
+               public
+               HttpCacheVaryByHeaders ()
                {
                        /* the field names are meant to be case insensitive */
-#if NET_2_0
                        fields = new Hashtable (StringComparer.InvariantCultureIgnoreCase);
-#else
-                       fields = new Hashtable(CaseInsensitiveHashCodeProvider.Default,
-                                              CaseInsensitiveComparer.Default);
-#endif
                }
 
-               internal string[] GetHeaderNames ()
+               internal string[] GetHeaderNames (bool omitVaryStar)
                {
                        string[] names;
 
-                       if (vary_by_unspecified) {
+                       if (vary_by_unspecified && !omitVaryStar) {
                                names = new string[1];
                                names[0] = "*";
                        }