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.
@@ -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
  )
@@ -1,4 +1,4 @@
1
- const version = "2.13.0-20260107-111908-1e9a7f50";
1
+ const version = "2.13.0-20260107-191028-be316b49";
2
2
 
3
3
  const compatibilityChanges = [
4
4
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitropack-nightly",
3
- "version": "2.13.0-20260107-111908-1e9a7f50",
3
+ "version": "2.13.0-20260107-191028-be316b49",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "repository": "nitrojs/nitro",
6
6
  "license": "MIT",