Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fetch undici agent support, node 16+ #233

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ealcantara22
Copy link
Member

since node 16 node's built-in fetch() global does not use the HTTP stack provided by the traditional built-in http/https modules. We relied on those modules to handle local self-sign SSL certificate requests against clay sites.

Problem: import commands using any version of node higher or equal to 16 against a local clay instance fail.
e.g.: export | import using node 20
image

after this fix:
image

@ealcantara22 ealcantara22 self-assigned this Aug 23, 2024
@ealcantara22 ealcantara22 changed the title fix: fetch undici agent support for self-signed certificate request, node 16+ fix: fetch undici agent support for self-signed certificate requests, node 16+ Aug 23, 2024
@ealcantara22 ealcantara22 changed the title fix: fetch undici agent support for self-signed certificate requests, node 16+ fix: fetch undici agent support, node 16+ Aug 27, 2024
const h = require('highland'),
_ = require('lodash'),
nodeUrl = require('url'),
https = require('https'),
{ Agent } = require('undici'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node 20 already has undici for its native fetch, but I think this is a good idea to maintain compatibility with other Node versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants