From 2693946498f2f963ecebb9cb7e8c5242aec65811 Mon Sep 17 00:00:00 2001 From: jiahe Date: Tue, 21 Nov 2023 10:21:13 +0800 Subject: [PATCH 1/5] fix: enable cainfo --- lib/generated/CurlInfo.ts | 16 ++++++++++++++++ src/Curl.cc | 5 +++++ 2 files changed, 21 insertions(+) diff --git a/lib/generated/CurlInfo.ts b/lib/generated/CurlInfo.ts index a3852d8cc..246b785fb 100644 --- a/lib/generated/CurlInfo.ts +++ b/lib/generated/CurlInfo.ts @@ -32,6 +32,20 @@ export interface CurlInfo { */ readonly APPCONNECT_TIME_T: 'APPCONNECT_TIME_T' + /** + * Get the default value for . + * + * Official libcurl documentation: : [https://curl.haxx.se/libcurl/c/CURLINFO_CAINFO.html](https://curl.haxx.se/libcurl/c/CURLINFO_CAINFO.html) + */ + readonly CAINFO: 'CAINFO' + + /** + * Get the default value for . + * + * Official libcurl documentation: : [https://curl.haxx.se/libcurl/c/CURLINFO_CAPATH.html](https://curl.haxx.se/libcurl/c/CURLINFO_CAPATH.html) + */ + readonly CAPATH: 'CAPATH' + /** * Certificate chain. * @@ -488,6 +502,8 @@ export type CurlInfoName = | 'ACTIVESOCKET' | 'APPCONNECT_TIME' | 'APPCONNECT_TIME_T' + | 'CAINFO' + | 'CAPATH' | 'CERTINFO' | 'CONDITION_UNMET' | 'CONNECT_TIME' diff --git a/src/Curl.cc b/src/Curl.cc index ef42798ce..ae825e477 100644 --- a/src/Curl.cc +++ b/src/Curl.cc @@ -573,6 +573,11 @@ const std::vector curlInfoNotImplemented = { }; const std::vector curlInfoString = { +#if NODE_LIBCURL_VER_GE(7, 84, 0) + {"CAINFO", CURLINFO_CAINFO}, + {"CAPATH", CURLINFO_CAPATH}, +#endif + {"CONTENT_TYPE", CURLINFO_CONTENT_TYPE}, {"EFFECTIVE_URL", CURLINFO_EFFECTIVE_URL}, From d59ae2bcccce25aadd08e2ff1c755e06ac6bcc0c Mon Sep 17 00:00:00 2001 From: jiahe Date: Tue, 21 Nov 2023 10:29:22 +0800 Subject: [PATCH 2/5] chore: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e8c713cd1..5f55df23a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getinsomnia/node-libcurl", - "version": "2.3.6-21", + "version": "2.3.6-22", "description": "The fastest http(s) client (and much more) for Node.js - Node.js bindings for libcurl", "keywords": [ "node-curl", From ee10562482aea9d6ca801b73d39c71bec6f92563 Mon Sep 17 00:00:00 2001 From: jiahe Date: Tue, 21 Nov 2023 10:33:36 +0800 Subject: [PATCH 3/5] chore: add alpha --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5f55df23a..4e189a2f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@getinsomnia/node-libcurl", - "version": "2.3.6-22", + "version": "2.3.6-22-alpha", "description": "The fastest http(s) client (and much more) for Node.js - Node.js bindings for libcurl", "keywords": [ "node-curl", From 9a127c354b795261cec4fa1436bc26a25e929135 Mon Sep 17 00:00:00 2001 From: jiahe Date: Tue, 21 Nov 2023 15:05:35 +0800 Subject: [PATCH 4/5] fix: temp work around for https://github.com/nodejs/node-gyp/issues/2869 --- .github/workflows/build-and-release.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 4bc83063f..4118f2b76 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -89,6 +89,7 @@ jobs: run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: 'Publish Binary' run: | + pip install setuptools GIT_COMMIT=${{ github.sha }} GIT_TAG=$GIT_TAG ./scripts/ci/build.sh - name: Upload artifacts if: always() @@ -177,6 +178,7 @@ jobs: run: echo "GIT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: 'Publish Binary' run: | + pip install setuptools GIT_COMMIT=${{ github.sha }} GIT_TAG=$GIT_TAG ./scripts/ci/build.sh - name: Upload artifacts if: always() @@ -225,6 +227,7 @@ jobs: - name: Publish binary if: startsWith(github.ref, 'refs/tags/') run: | + pip install setuptools yarn node-pre-gyp package testpackage --verbose node scripts\module-packaging.js --publish $(yarn -s node-pre-gyp reveal staged_tarball --silent) @@ -273,5 +276,6 @@ jobs: - name: Publish binary if: startsWith(github.ref, 'refs/tags/') run: | + pip install setuptools yarn node-pre-gyp package testpackage --verbose node scripts\module-packaging.js --publish $(yarn -s node-pre-gyp reveal staged_tarball --silent) From 02ead7cd2422e9c71ea888aec7f75c1d9457cc59 Mon Sep 17 00:00:00 2001 From: jiahe Date: Tue, 21 Nov 2023 15:28:55 +0800 Subject: [PATCH 5/5] chore: skip an upstream failed test --- test/curl/http2.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/curl/http2.spec.ts b/test/curl/http2.spec.ts index 43c80cc41..3f465f0b2 100644 --- a/test/curl/http2.spec.ts +++ b/test/curl/http2.spec.ts @@ -60,7 +60,7 @@ describe('HTTP2', () => { }) // skipped until https://github.com/nodejs/node/issues/42713 is fixed - it('should work with https2 site', (done) => { + xit('should work with https2 site', (done) => { const curl = new Curl() curl.setOpt('URL', `https://${host}:${portHttp2}/`)