@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.
@@ -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
  *
@@ -1179,8 +1179,6 @@
1179
1179
  }
1180
1180
  return pathname.slice(startIndex) || "/";
1181
1181
  }
1182
- const ABSOLUTE_URL_REGEX$1 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
1183
- const isAbsoluteUrl = url => ABSOLUTE_URL_REGEX$1.test(url);
1184
1182
 
1185
1183
  /**
1186
1184
  * Returns a resolved path object relative to the given pathname.
@@ -1198,19 +1196,11 @@
1198
1196
  } = typeof to === "string" ? parsePath(to) : to;
1199
1197
  let pathname;
1200
1198
  if (toPathname) {
1201
- if (isAbsoluteUrl(toPathname)) {
1202
- pathname = toPathname;
1199
+ toPathname = removeDoubleSlashes(toPathname);
1200
+ if (toPathname.startsWith("/")) {
1201
+ pathname = resolvePathname(toPathname.substring(1), "/");
1203
1202
  } else {
1204
- if (toPathname.includes("//")) {
1205
- let oldPathname = toPathname;
1206
- toPathname = removeDoubleSlashes(toPathname);
1207
- warning(false, "Pathnames cannot have embedded double slashes - normalizing " + (oldPathname + " -> " + toPathname));
1208
- }
1209
- if (toPathname.startsWith("/")) {
1210
- pathname = resolvePathname(toPathname.substring(1), "/");
1211
- } else {
1212
- pathname = resolvePathname(toPathname, fromPathname);
1213
- }
1203
+ pathname = resolvePathname(toPathname, fromPathname);
1214
1204
  }
1215
1205
  } else {
1216
1206
  pathname = fromPathname;