nuxt-site-config-kit 3.2.16 → 3.2.18
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/util.cjs +9 -1
- package/dist/util.mjs +9 -1
- package/package.json +3 -3
package/dist/util.cjs
CHANGED
|
@@ -13,10 +13,18 @@ function getNitroOrigin(ctx = {}) {
|
|
|
13
13
|
if (devEnv) {
|
|
14
14
|
const parsed = JSON.parse(devEnv);
|
|
15
15
|
const origin = parsed.proxy?.url || parsed.baseURL?.replace("/__nuxt_vite_node__", "");
|
|
16
|
-
host = origin.replace(/^https?:\/\//, "");
|
|
16
|
+
host = origin.replace(/^https?:\/\//, "").replace(/\/$/, "");
|
|
17
17
|
protocol = origin.startsWith("https") ? "https" : "http";
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
const hostIsLocalhost = !host || host.startsWith("localhost") || host.startsWith("127.");
|
|
21
|
+
if (isDev && hostIsLocalhost && ctx.requestHost) {
|
|
22
|
+
const reqHost = ctx.requestHost.split(":")[0] || "";
|
|
23
|
+
if (reqHost && !reqHost.startsWith("localhost") && !reqHost.startsWith("127.")) {
|
|
24
|
+
host = ctx.requestHost;
|
|
25
|
+
protocol = ctx.requestProtocol || protocol;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
20
28
|
if (!host && ctx.requestHost) {
|
|
21
29
|
host = ctx.requestHost;
|
|
22
30
|
protocol = ctx.requestProtocol || protocol;
|
package/dist/util.mjs
CHANGED
|
@@ -11,10 +11,18 @@ function getNitroOrigin(ctx = {}) {
|
|
|
11
11
|
if (devEnv) {
|
|
12
12
|
const parsed = JSON.parse(devEnv);
|
|
13
13
|
const origin = parsed.proxy?.url || parsed.baseURL?.replace("/__nuxt_vite_node__", "");
|
|
14
|
-
host = origin.replace(/^https?:\/\//, "");
|
|
14
|
+
host = origin.replace(/^https?:\/\//, "").replace(/\/$/, "");
|
|
15
15
|
protocol = origin.startsWith("https") ? "https" : "http";
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
+
const hostIsLocalhost = !host || host.startsWith("localhost") || host.startsWith("127.");
|
|
19
|
+
if (isDev && hostIsLocalhost && ctx.requestHost) {
|
|
20
|
+
const reqHost = ctx.requestHost.split(":")[0] || "";
|
|
21
|
+
if (reqHost && !reqHost.startsWith("localhost") && !reqHost.startsWith("127.")) {
|
|
22
|
+
host = ctx.requestHost;
|
|
23
|
+
protocol = ctx.requestProtocol || protocol;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
18
26
|
if (!host && ctx.requestHost) {
|
|
19
27
|
host = ctx.requestHost;
|
|
20
28
|
protocol = ctx.requestProtocol || protocol;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-site-config-kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.2.
|
|
4
|
+
"version": "3.2.18",
|
|
5
5
|
"description": "Shared site configuration build-time utilities for Nuxt 3 modules.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"@nuxt/kit": "^4.2.2",
|
|
46
46
|
"pkg-types": "^2.3.0",
|
|
47
47
|
"std-env": "^3.10.0",
|
|
48
|
-
"ufo": "^1.6.
|
|
49
|
-
"site-config-stack": "3.2.
|
|
48
|
+
"ufo": "^1.6.3",
|
|
49
|
+
"site-config-stack": "3.2.18"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@nuxt/schema": "^4.2.2"
|