@sveltejs/adapter-vercel 6.3.1 → 6.3.2

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.
Files changed (2) hide show
  1. package/index.js +23 -0
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -616,6 +616,19 @@ function static_vercel_config(builder, config, dir) {
616
616
  }
617
617
 
618
618
  const routes = [
619
+ // Strip any user-supplied __pathname query parameter; SvelteKit reserves
620
+ // this for ISR handlers
621
+ {
622
+ src: '.*',
623
+ continue: true,
624
+ transforms: [
625
+ {
626
+ type: 'request.query',
627
+ op: 'delete',
628
+ target: { key: '__pathname' }
629
+ }
630
+ ]
631
+ },
619
632
  ...prerendered_redirects,
620
633
  {
621
634
  src: `/${builder.getAppPath()}/immutable/.+`,
@@ -666,6 +679,16 @@ function static_vercel_config(builder, config, dir) {
666
679
  handle: 'filesystem'
667
680
  });
668
681
 
682
+ // Prevent incorrect caching: if a request to /_app/immutable/* doesn't match
683
+ // a static file, return 404 instead of falling through to dynamic routes.
684
+ // Otherwise, we could accidentally immutably cache dynamic content served
685
+ // by the fallback function.
686
+ routes.push({
687
+ src: `/${builder.getAppPath()}/immutable/.+`,
688
+ status: 404,
689
+ continue: false
690
+ });
691
+
669
692
  return {
670
693
  version: 3,
671
694
  routes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/adapter-vercel",
3
- "version": "6.3.1",
3
+ "version": "6.3.2",
4
4
  "description": "A SvelteKit adapter that creates a Vercel app",
5
5
  "keywords": [
6
6
  "adapter",
@@ -42,7 +42,7 @@
42
42
  "@types/node": "^18.19.119",
43
43
  "typescript": "^5.3.3",
44
44
  "vitest": "^4.0.0",
45
- "@sveltejs/kit": "^2.50.1"
45
+ "@sveltejs/kit": "^2.52.2"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@sveltejs/kit": "^2.4.0"