From 87a2e7f9a2b72926ca39469035dc1f8b241e8cac Mon Sep 17 00:00:00 2001 From: Shazron Abdullah <36107+shazron@users.noreply.github.com> Date: Wed, 6 Dec 2023 00:14:54 +0800 Subject: [PATCH] fix(breaking-change): update for nodes 18 and 20 (#59) --- .github/workflows/daily.yml | 4 ++-- .github/workflows/node.js.yml | 2 +- .github/workflows/on-push-publish-to-npm.yml | 2 +- .github/workflows/prerelease.yml | 2 +- .github/workflows/version-bump-publish.yml | 2 +- package.json | 2 +- src/ProxyFetch.js | 2 ++ 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 21d6d42..0c1fe67 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node: [16] + node-version: [18] os: [ubuntu-latest] steps: @@ -29,6 +29,6 @@ jobs: env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_TITLE: 'Node version' - SLACK_MESSAGE: ${{ matrix.node }} + SLACK_MESSAGE: ${{ matrix.node-version }} SLACK_COLOR: ${{ job.status == 'success' && 'good' || job.status == 'cancelled' && '#808080' || 'danger' }} diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 38e3739..e8dbe63 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -17,7 +17,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node-version: [14.x, 16.x] + node-version: [18.x, 20.x] os: [ubuntu-latest, windows-latest] steps: diff --git a/.github/workflows/on-push-publish-to-npm.yml b/.github/workflows/on-push-publish-to-npm.yml index eb86442..42d19fc 100644 --- a/.github/workflows/on-push-publish-to-npm.yml +++ b/.github/workflows/on-push-publish-to-npm.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - node-version: 16 + node-version: 18 - run: npm install - run: npm test - uses: JS-DevTools/npm-publish@v1 diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index f512650..ef17c90 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -26,7 +26,7 @@ jobs: git config user.email github-actions@github.com - uses: actions/setup-node@v1 with: - node-version: 16 + node-version: 18 - run: | npm install npm test diff --git a/.github/workflows/version-bump-publish.yml b/.github/workflows/version-bump-publish.yml index 37ae2b6..1c8c0bf 100644 --- a/.github/workflows/version-bump-publish.yml +++ b/.github/workflows/version-bump-publish.yml @@ -21,7 +21,7 @@ jobs: git config user.email github-actions@github.com - uses: actions/setup-node@v1 with: - node-version: 16 + node-version: 18 - run: | npm install npm test diff --git a/package.json b/package.json index d4ff1eb..c3b4fe1 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,6 @@ "unit-tests": "jest --config test/jest.config.js --runInBand" }, "engines": { - "node": "^14.16 || ^16.13 || >=18" + "node": ">=18" } } diff --git a/src/ProxyFetch.js b/src/ProxyFetch.js index 379e088..780816d 100644 --- a/src/ProxyFetch.js +++ b/src/ProxyFetch.js @@ -42,6 +42,8 @@ function proxyAgent (resourceUrl, authOptions) { logger.warn(`proxyAgent - rejectUnauthorized is set to ${rejectUnauthorized}`) } + proxyOpts.ALPNProtocols = ['http/1.1'] + if (resourceUrl.startsWith('https')) { return new HttpsProxyAgent(proxyOpts) } else {