@remix-run/router 1.23.3 → 1.23.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # `@remix-run/router`
2
2
 
3
+ ## v1.23.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix double slash normalization for `useNavigate` colon urls ([3ed85d5](https://github.com/remix-run/react-router/commit/3ed85d5))
8
+
9
+ - As a reminder, `navigate()` is only intended for navigations within the React Router application and not for external navigations to other domains
10
+ - This change may be a breaking bug fix if you are using `navigate` for external navigations
11
+
3
12
  ## v1.23.3
4
13
 
5
14
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @remix-run/router v1.23.3
2
+ * @remix-run/router v1.23.4
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1177,8 +1177,6 @@ function stripBasename(pathname, basename) {
1177
1177
  }
1178
1178
  return pathname.slice(startIndex) || "/";
1179
1179
  }
1180
- const ABSOLUTE_URL_REGEX$1 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
1181
- const isAbsoluteUrl = url => ABSOLUTE_URL_REGEX$1.test(url);
1182
1180
 
1183
1181
  /**
1184
1182
  * Returns a resolved path object relative to the given pathname.
@@ -1196,19 +1194,11 @@ function resolvePath(to, fromPathname) {
1196
1194
  } = typeof to === "string" ? parsePath(to) : to;
1197
1195
  let pathname;
1198
1196
  if (toPathname) {
1199
- if (isAbsoluteUrl(toPathname)) {
1200
- pathname = toPathname;
1197
+ toPathname = removeDoubleSlashes(toPathname);
1198
+ if (toPathname.startsWith("/")) {
1199
+ pathname = resolvePathname(toPathname.substring(1), "/");
1201
1200
  } else {
1202
- if (toPathname.includes("//")) {
1203
- let oldPathname = toPathname;
1204
- toPathname = removeDoubleSlashes(toPathname);
1205
- warning(false, "Pathnames cannot have embedded double slashes - normalizing " + (oldPathname + " -> " + toPathname));
1206
- }
1207
- if (toPathname.startsWith("/")) {
1208
- pathname = resolvePathname(toPathname.substring(1), "/");
1209
- } else {
1210
- pathname = resolvePathname(toPathname, fromPathname);
1211
- }
1201
+ pathname = resolvePathname(toPathname, fromPathname);
1212
1202
  }
1213
1203
  } else {
1214
1204
  pathname = fromPathname;