nitropack-nightly 2.13.0-20260107-111908-1e9a7f50 → 2.13.0-20260107-191028-be316b49
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/core/index.mjs +16 -0
- package/dist/meta/index.mjs +1 -1
- package/package.json +1 -1
package/dist/core/index.mjs
CHANGED
|
@@ -2822,6 +2822,9 @@ class DevServer {
|
|
|
2822
2822
|
app.use(handler.route || "/", handler.handler);
|
|
2823
2823
|
}
|
|
2824
2824
|
app.use("/_vfs", createVFSHandler(this.nitro));
|
|
2825
|
+
const routeRulesMatcher = toRouteMatcher(
|
|
2826
|
+
createRouter({ routes: this.nitro.options.routeRules })
|
|
2827
|
+
);
|
|
2825
2828
|
for (const asset of this.nitro.options.publicAssets) {
|
|
2826
2829
|
const url = joinURL(
|
|
2827
2830
|
this.nitro.options.runtimeConfig.app.baseURL,
|
|
@@ -2836,6 +2839,19 @@ class DevServer {
|
|
|
2836
2839
|
if (path.endsWith(".gz")) {
|
|
2837
2840
|
res.setHeader("Content-Encoding", "gzip");
|
|
2838
2841
|
}
|
|
2842
|
+
const pathname = res.req?._parsedOriginalUrl?.pathname;
|
|
2843
|
+
if (pathname) {
|
|
2844
|
+
const rules = defu$1(
|
|
2845
|
+
{},
|
|
2846
|
+
...routeRulesMatcher.matchAll(pathname).reverse()
|
|
2847
|
+
);
|
|
2848
|
+
if (rules.headers) {
|
|
2849
|
+
for (const [k, v] of Object.entries(rules.headers)) {
|
|
2850
|
+
if (k === "cache-control") continue;
|
|
2851
|
+
res.appendHeader(k, v);
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2839
2855
|
}
|
|
2840
2856
|
})
|
|
2841
2857
|
)
|
package/dist/meta/index.mjs
CHANGED
package/package.json
CHANGED