Uri.Merge ignores on 2.0 base filename when relative has a query.
authorMarcos Henrich <marcos.henrich@xamarin.com>
Wed, 23 Jul 2014 10:46:51 +0000 (11:46 +0100)
committerMarcos Henrich <marcos.henrich@xamarin.com>
Wed, 23 Jul 2014 10:46:51 +0000 (11:46 +0100)
mcs/class/System/System/Uri.cs

index 531c304927a2cc382606742313cdda01ccac2714..22c587e22b8963ef6c2f48042bc36a5a8afcdc14 100644 (file)
@@ -339,8 +339,15 @@ namespace System {
                                        path = (pathEnd > 0)? baseEl.path.Substring (0, pathEnd+1) : "";
                                        path += relativeEl.path;
                                }
-                       } else
+                       } else {
                                path = baseEl.path;
+#if !NET_4_0
+                               if (relativeEl.query != null) {
+                                       var pathEnd = path.LastIndexOf ('/');
+                                       path = (pathEnd > 0)? path.Substring (0, pathEnd+1) : "";
+                               }
+#endif
+                       }
 
                        if ((path.Length == 0 || path [0] != '/') && baseEl.delimiter == SchemeDelimiter)
                                path = "/" + path;