Skip to content

Commit

Permalink
fix undici when node is built with --without-ssl (nodejs#2272)
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev authored and crysmags committed Feb 27, 2024
1 parent 426cdd3 commit 9f2c705
Showing 1 changed file with 10 additions and 1 deletion.
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

0 comments on commit 9f2c705

Please sign in to comment.