* SessionStateModule.cs: If using cookieless sessions add an
[mono.git] / mcs / class / System.Web / System.Web.Configuration / HandlerFactoryConfiguration.cs
index c80ac6926709962714f880401772a7cfab285c59..2dbab0a1ac88d06cf7eab0e386ca38e712a8d160 100644 (file)
@@ -15,6 +15,7 @@ namespace System.Web.Configuration
        class HandlerFactoryConfiguration
        {
                ArrayList mappings;
+               int ownIndex;
 
                public HandlerFactoryConfiguration () : this (null)
                {
@@ -26,6 +27,8 @@ namespace System.Web.Configuration
                                mappings = new ArrayList (parent.mappings);
                        else
                                mappings = new ArrayList ();
+
+                       ownIndex = mappings.Count;
                }
 
                public void Add (HandlerItem mapping)
@@ -62,6 +65,14 @@ namespace System.Web.Configuration
                {
                        int end = mappings.Count;
 
+                       for (int i = ownIndex; i < end; i++) {
+                               HandlerItem item = (HandlerItem) mappings [i];
+                               if (item.IsMatch (verb, path))
+                                       return i;
+                       }
+
+                       // parent mappings
+                       end = ownIndex;
                        for (int i = 0; i < end; i++) {
                                HandlerItem item = (HandlerItem) mappings [i];
                                if (item.IsMatch (verb, path))