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 undici when node is built with --without-ssl #2272

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

const assert = require('assert')
const net = require('net')
const http2 = require('http2')
const { pipeline } = require('stream')
const util = require('./core/util')
const timers = require('./timers')
Expand Down Expand Up @@ -79,6 +78,16 @@ const {
kHTTP2CopyHeaders,
kHTTP1BuildRequest
} = require('./core/symbols')

/** @type {import('http2')} */
let http2
try {
http2 = require('http2')
} catch {
// @ts-ignore
http2 = { constants: {} }
}

const {
constants: {
HTTP2_HEADER_AUTHORITY,
Expand Down
Loading