Преглед на файлове

2004-01-20 Gonzalo Paniagua Javier <[email protected]>

	* WebConfigurationSettings.cs: fix location path lookup. Closes bug
	#53072.

svn path=/trunk/mcs/; revision=22280
Gonzalo Paniagua Javier преди 22 години
родител
ревизия
8a0faae09f

+ 5 - 0
mcs/class/System.Web/System.Web.Configuration/ChangeLog

@@ -1,3 +1,8 @@
+2004-01-20  Gonzalo Paniagua Javier <[email protected]>
+
+	* WebConfigurationSettings.cs: fix location path lookup. Closes bug
+	#53072.
+
 2004-01-12  Gonzalo Paniagua Javier <[email protected]>
 
 	* System.Web.Configuration/GlobalizationConfiguration.cs: undo old fix.

+ 18 - 1
mcs/class/System.Web/System.Web.Configuration/WebConfigurationSettings.cs

@@ -486,7 +486,24 @@ namespace System.Web.Configuration
 		{
 			if (locations != null && dirname != null) {
 				string reduced = UrlUtils.MakeRelative (context.Request.FilePath, dirname);
-				Location location = locations [reduced] as Location;
+				string [] parts = reduced.Split ('/');
+				Location location = null;
+				int length = parts.Length;
+
+				string target = null;
+				for (int i = 0; i < parts.Length; i++) {
+					if (target == null)
+						target = parts [i];
+					else
+						target = target + "/" + parts [i];
+
+					if (locations.ContainsKey (target)) {
+						location = locations [target] as Location;
+					} else if (locations.ContainsKey (target + "/*")) {
+						location = locations [target + "/*"] as Location;
+					}
+				}
+				
 				if (location == null) {
 					location = locations ["*"] as Location;
 				}