@esmx/router 3.0.0-rc.54 → 3.0.0-rc.55

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/dist/location.mjs CHANGED
@@ -4,7 +4,8 @@ export function normalizeURL(url, base) {
4
4
  return url;
5
5
  }
6
6
  if (url.startsWith("//")) {
7
- return new URL("http:".concat(url));
7
+ const protocol = base.protocol;
8
+ return new URL("".concat(protocol).concat(url));
8
9
  }
9
10
  if (url.startsWith("/")) {
10
11
  const newBase = new URL(".", base);
package/package.json CHANGED
@@ -39,7 +39,7 @@
39
39
  "unbuild": "3.5.0",
40
40
  "vitest": "3.2.4"
41
41
  },
42
- "version": "3.0.0-rc.54",
42
+ "version": "3.0.0-rc.55",
43
43
  "type": "module",
44
44
  "private": false,
45
45
  "exports": {
@@ -58,5 +58,5 @@
58
58
  "template",
59
59
  "public"
60
60
  ],
61
- "gitHead": "85a92c42adcbbcbf0c0b75024e32ba8fcb1e17ca"
61
+ "gitHead": "e7d0c88a376ad5bd3d88a48240e4ed4891c0b275"
62
62
  }
package/src/location.ts CHANGED
@@ -14,8 +14,9 @@ export function normalizeURL(url: string | URL, base: URL): URL {
14
14
 
15
15
  // Handle protocol-relative URLs (e.g., //example.com)
16
16
  if (url.startsWith('//')) {
17
- // Using http: as a default protocol for protocol-relative URLs.
18
- return new URL(`http:${url}`);
17
+ // Use the current base URL's protocol for security and consistency
18
+ const protocol = base.protocol;
19
+ return new URL(`${protocol}${url}`);
19
20
  }
20
21
 
21
22
  // Handle root-relative paths