@vercel/next 3.2.10 → 3.2.11

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/index.js CHANGED
@@ -42986,6 +42986,8 @@ function convertRedirects(redirects, defaultStatus = 308) {
42986
42986
  return redirects.map(r => {
42987
42987
  const { src, segments } = sourceToRegex(r.source);
42988
42988
  const hasSegments = collectHasSegments(r.has);
42989
+ normalizeHasKeys(r.has);
42990
+ normalizeHasKeys(r.missing);
42989
42991
  try {
42990
42992
  const loc = replaceSegments(segments, hasSegments, r.destination, true);
42991
42993
  let status;
@@ -43006,6 +43008,9 @@ function convertRedirects(redirects, defaultStatus = 308) {
43006
43008
  if (r.has) {
43007
43009
  route.has = r.has;
43008
43010
  }
43011
+ if (r.missing) {
43012
+ route.missing = r.missing;
43013
+ }
43009
43014
  return route;
43010
43015
  }
43011
43016
  catch (e) {
@@ -43018,12 +43023,17 @@ function convertRewrites(rewrites, internalParamNames) {
43018
43023
  return rewrites.map(r => {
43019
43024
  const { src, segments } = sourceToRegex(r.source);
43020
43025
  const hasSegments = collectHasSegments(r.has);
43026
+ normalizeHasKeys(r.has);
43027
+ normalizeHasKeys(r.missing);
43021
43028
  try {
43022
43029
  const dest = replaceSegments(segments, hasSegments, r.destination, false, internalParamNames);
43023
43030
  const route = { src, dest, check: true };
43024
43031
  if (r.has) {
43025
43032
  route.has = r.has;
43026
43033
  }
43034
+ if (r.missing) {
43035
+ route.missing = r.missing;
43036
+ }
43027
43037
  return route;
43028
43038
  }
43029
43039
  catch (e) {
@@ -43037,6 +43047,8 @@ function convertHeaders(headers) {
43037
43047
  const obj = {};
43038
43048
  const { src, segments } = sourceToRegex(h.source);
43039
43049
  const hasSegments = collectHasSegments(h.has);
43050
+ normalizeHasKeys(h.has);
43051
+ normalizeHasKeys(h.missing);
43040
43052
  const namedSegments = segments.filter(name => name !== UN_NAMED_SEGMENT);
43041
43053
  const indexes = {};
43042
43054
  segments.forEach((name, index) => {
@@ -43064,6 +43076,9 @@ function convertHeaders(headers) {
43064
43076
  if (h.has) {
43065
43077
  route.has = h.has;
43066
43078
  }
43079
+ if (h.missing) {
43080
+ route.missing = h.missing;
43081
+ }
43067
43082
  return route;
43068
43083
  });
43069
43084
  }
@@ -43114,12 +43129,17 @@ function sourceToRegex(source) {
43114
43129
  }
43115
43130
  exports.sourceToRegex = sourceToRegex;
43116
43131
  const namedGroupsRegex = /\(\?<([a-zA-Z][a-zA-Z0-9]*)>/g;
43117
- function collectHasSegments(has) {
43118
- const hasSegments = new Set();
43119
- for (const hasItem of has || []) {
43132
+ const normalizeHasKeys = (hasItems = []) => {
43133
+ for (const hasItem of hasItems) {
43120
43134
  if ('key' in hasItem && hasItem.type === 'header') {
43121
43135
  hasItem.key = hasItem.key.toLowerCase();
43122
43136
  }
43137
+ }
43138
+ return hasItems;
43139
+ };
43140
+ function collectHasSegments(has) {
43141
+ const hasSegments = new Set();
43142
+ for (const hasItem of has || []) {
43123
43143
  if (!hasItem.value && 'key' in hasItem) {
43124
43144
  hasSegments.add(hasItem.key);
43125
43145
  }
@@ -48502,6 +48522,7 @@ async function getMiddlewareBundle({ entryPath, outputDirectory, routesManifest,
48502
48522
  key: 'x-prerender-revalidate',
48503
48523
  value: prerenderBypassToken,
48504
48524
  },
48525
+ ...(matcher.missing || []),
48505
48526
  ],
48506
48527
  };
48507
48528
  route.middlewarePath = shortPath;
@@ -48601,6 +48622,9 @@ function getRouteMatchers(info, { basePath = '', i18n }) {
48601
48622
  if (matcher.has) {
48602
48623
  m.has = normalizeHas(matcher.has);
48603
48624
  }
48625
+ if (matcher.missing) {
48626
+ m.missing = normalizeHas(matcher.missing);
48627
+ }
48604
48628
  return m;
48605
48629
  });
48606
48630
  }
package/dist/utils.js CHANGED
@@ -1549,6 +1549,7 @@ async function getMiddlewareBundle({ entryPath, outputDirectory, routesManifest,
1549
1549
  key: 'x-prerender-revalidate',
1550
1550
  value: prerenderBypassToken,
1551
1551
  },
1552
+ ...(matcher.missing || []),
1552
1553
  ],
1553
1554
  };
1554
1555
  route.middlewarePath = shortPath;
@@ -1648,6 +1649,9 @@ function getRouteMatchers(info, { basePath = '', i18n }) {
1648
1649
  if (matcher.has) {
1649
1650
  m.has = normalizeHas(matcher.has);
1650
1651
  }
1652
+ if (matcher.missing) {
1653
+ m.missing = normalizeHas(matcher.missing);
1654
+ }
1651
1655
  return m;
1652
1656
  });
1653
1657
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/next",
3
- "version": "3.2.10",
3
+ "version": "3.2.11",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
@@ -46,7 +46,7 @@
46
46
  "@types/webpack-sources": "3.2.0",
47
47
  "@vercel/build-utils": "5.5.7",
48
48
  "@vercel/nft": "0.22.1",
49
- "@vercel/routing-utils": "2.1.2",
49
+ "@vercel/routing-utils": "2.1.3",
50
50
  "async-sema": "3.0.1",
51
51
  "buffer-crc32": "0.2.13",
52
52
  "cheerio": "1.0.0-rc.10",
@@ -69,5 +69,5 @@
69
69
  "typescript": "4.5.2",
70
70
  "webpack-sources": "3.2.3"
71
71
  },
72
- "gitHead": "fbb8bba4cfb06040d62916bdc3fc849ac0b4d074"
72
+ "gitHead": "1b211f28dfdcb112f1aecb53a2b9f257ecc58420"
73
73
  }