Index: sdk/lib/core/uri.dart |
diff --git a/sdk/lib/core/uri.dart b/sdk/lib/core/uri.dart |
index 3eb81a47b1376db26fec5fb89132465db23255cd..78f42de6bdd52bbf322cd55c9ab71673557bbad9 100644 |
--- a/sdk/lib/core/uri.dart |
+++ b/sdk/lib/core/uri.dart |
@@ -986,6 +986,16 @@ class Uri { |
} |
/** |
+ * Returns a `Uri` that differs from this only in not having a fragment. |
+ * |
+ * If this `Uri` does not have a fragment, it is itself returned. |
+ */ |
+ Uri removeFragment() { |
+ if (!this.hasFragment) return this; |
+ return new Uri._internal(scheme, userInfo, host, port, path, query, null); |
+ } |
+ |
+ /** |
* Returns the URI path split into its segments. Each of the |
* segments in the returned list have been decoded. If the path is |
* empty the empty list will be returned. A leading slash `/` does |