[HttpListener] Fix matching directories
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Tue, 19 Apr 2011 17:54:27 +0000 (13:54 -0400)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Tue, 19 Apr 2011 17:56:19 +0000 (13:56 -0400)
/foo was not properly matched.
Fixes bug #688353.

mcs/class/System/System.Net/EndPointListener.cs

index fa6827e8a6e0b591b76ab6376edb093aa32feb83..34fe18fe888efe3e89db5cd1e0096bec7a2d528e 100644 (file)
@@ -180,13 +180,18 @@ namespace System.Net {
 
                        ArrayList list = unhandled;
                        best_match = MatchFromList (host, path, list, out prefix);
+                       if (path != path_slash && best_match == null)
+                               best_match = MatchFromList (host, path_slash, list, out prefix);
                        if (best_match != null)
                                return best_match;
 
                        list = all;
                        best_match = MatchFromList (host, path, list, out prefix);
+                       if (path != path_slash && best_match == null)
+                               best_match = MatchFromList (host, path_slash, list, out prefix);
                        if (best_match != null)
                                return best_match;
+
                        return null;
                }