@vercel/node 2.14.1 → 2.14.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.
@@ -10,8 +10,7 @@ import { createServerlessEventHandler } from './serverless-functions/serverless-
10
10
  import { isEdgeRuntime, logError, validateConfiguredRuntime } from './utils.js';
11
11
  import { getConfig } from '@vercel/static-config';
12
12
  import { Project } from 'ts-morph';
13
- import asyncListen from 'async-listen';
14
- const { default: listen } = asyncListen;
13
+ import { listen } from 'async-listen';
15
14
  const parseConfig = (entryPointPath) => getConfig(new Project(), entryPointPath);
16
15
  async function createEventHandler(entrypoint, config, options) {
17
16
  const entrypointPath = join(process.cwd(), entrypoint);
@@ -72,8 +71,10 @@ async function onDevRequest(req, res) {
72
71
  const { headers, body, status } = await handleEvent(req);
73
72
  res.statusCode = status;
74
73
  for (const [key, value] of headers) {
74
+ // node-fetch does not support headers.getSetCookie(), so we need to
75
+ // manually set the raw value which can be an array of strings
75
76
  if (value !== undefined) {
76
- res.setHeader(key, value);
77
+ res.setHeader(key, key === 'set-cookie' ? headers.raw()[key] : value);
77
78
  }
78
79
  }
79
80
  if (body instanceof Buffer) {
@@ -4,10 +4,9 @@ import { serializeBody } from '../utils.js';
4
4
  import { streamToBuffer } from '@vercel/build-utils';
5
5
  import exitHook from 'exit-hook';
6
6
  import fetch from 'node-fetch';
7
- import asyncListen from 'async-listen';
7
+ import { listen } from 'async-listen';
8
8
  import { isAbsolute } from 'path';
9
9
  import { pathToFileURL } from 'url';
10
- const { default: listen } = asyncListen;
11
10
  async function createServerlessServer(userCode, options) {
12
11
  const server = createServer(async (req, res) => {
13
12
  if (options.shouldAddHelpers)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/node",
3
- "version": "2.14.1",
3
+ "version": "2.14.2",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -25,7 +25,7 @@
25
25
  "@vercel/build-utils": "6.7.2",
26
26
  "@vercel/error-utils": "1.0.8",
27
27
  "@vercel/static-config": "2.0.17",
28
- "async-listen": "1.2.0",
28
+ "async-listen": "3.0.0",
29
29
  "edge-runtime": "2.1.4",
30
30
  "esbuild": "0.14.47",
31
31
  "exit-hook": "2.2.1",
@@ -57,5 +57,5 @@
57
57
  "source-map-support": "0.5.12",
58
58
  "test-listen": "1.1.0"
59
59
  },
60
- "gitHead": "672c1681cc453744e30f985d3e532111d4d7b120"
60
+ "gitHead": "d1d3e9384d139a06acca521348f8f9209bb3d214"
61
61
  }