Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docs/examples/ca-fingerprint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const crypto = require('node:crypto')
const https = require('node:https')
const { Client, buildConnector } = require('../../../')
const pem = require('https-pem')
const pem = require('../../../test/fixtures/https-pem.js')

const caFingerprint = getFingerprint(pem.cert.toString()
.split('\n')
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,11 @@
"scripts": {
"build:node": "esbuild index-fetch.js --bundle --platform=node --outfile=undici-fetch.js --define:esbuildDetection=1 --keep-names && node scripts/strip-comments.js",
"build:wasm": "node build/wasm.js --docker",
"generate-pem": "node scripts/generate-pem.js",
"lint": "eslint --cache",
"lint:fix": "eslint --fix --cache",
"test": "npm run test:javascript && cross-env NODE_V8_COVERAGE= npm run test:typescript",
"test:javascript": "npm run test:javascript:no-jest && npm run test:jest",
"test:javascript:no-jest": "npm run generate-pem && npm run test:unit && npm run test:node-fetch && npm run test:cache && npm run test:cache-interceptor && npm run test:interceptors && npm run test:fetch && npm run test:cookies && npm run test:eventsource && npm run test:wpt && npm run test:websocket && npm run test:node-test && npm run test:cache-tests",
"test:javascript:no-jest": "npm run test:unit && npm run test:node-fetch && npm run test:cache && npm run test:cache-interceptor && npm run test:interceptors && npm run test:fetch && npm run test:cookies && npm run test:eventsource && npm run test:wpt && npm run test:websocket && npm run test:node-test && npm run test:cache-tests",
"test:javascript:without-intl": "npm run test:javascript:no-jest",
"test:busboy": "borp -p \"test/busboy/*.js\"",
"test:cache": "borp -p \"test/cache/*.js\"",
Expand Down Expand Up @@ -119,7 +118,6 @@
"esbuild": "^0.25.2",
"eslint": "^9.9.0",
"fast-check": "^4.1.1",
"https-pem": "^3.0.0",
"husky": "^9.0.7",
"jest": "^29.0.2",
"neostandard": "^0.12.0",
Expand Down
4 changes: 0 additions & 4 deletions scripts/generate-pem.js

This file was deleted.

2 changes: 1 addition & 1 deletion test/connect-pre-shared-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const { tspl } = require('@matteo.collina/tspl')
const { test, after, mock } = require('node:test')
const { Client } = require('..')
const { createServer } = require('node:https')
const pem = require('https-pem')
const tls = require('node:tls')
const pem = require('./fixtures/https-pem.js')

test('custom session passed to client will be used in tls connect call', async (t) => {
t = tspl(t, { plan: 4 })
Expand Down
2 changes: 1 addition & 1 deletion test/fetch/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const assert = require('node:assert')
const { tspl } = require('@matteo.collina/tspl')
const { Client, fetch, Headers } = require('../..')
const { closeServerAsPromise } = require('../utils/node-http')
const pem = require('https-pem')
const { createSecureServer } = require('node:http2')
const { closeClientAndServerAsPromise } = require('../utils/node-http')
const pem = require('../fixtures/https-pem.js')

test('Can receive set-cookie headers from a server using fetch - issue #1262', async (t) => {
const server = createServer({ joinDuplicateHeaders: true }, (req, res) => {
Expand Down
2 changes: 1 addition & 1 deletion test/fetch/http2.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { Readable } = require('node:stream')

const { test } = require('node:test')
const { tspl } = require('@matteo.collina/tspl')
const pem = require('https-pem')
const pem = require('../fixtures/https-pem.js')

const { Client, fetch, Headers } = require('../..')

Expand Down
72 changes: 72 additions & 0 deletions test/fixtures/https-pem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
'use strict'

const key = `-----BEGIN PRIVATE KEY-----
MIIG/gIBADANBgkqhkiG9w0BAQEFAASCBugwggbkAgEAAoIBgQDwcIAYm12nmQTG
B3caFn7alDe3LSliEfNC2ZTR+5sh1eucQPbzgFM5SR4soKGElwI68Eg7g1kwqu3z
mrI/FAiQI/RrUHyBZiEtnFBPM44vY02XjUlJ9nBtgP7QjpRz6Z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876k3N3kCAwEAAaM3MDUwFAYDVR0RBA0wC4IJbG9j
YWxob3N0MB0GA1UdDgQWBBR459BlAel5MqCtG0DrvVtMZlQfuTANBgkqhkiG9w0B
AQsFAAOCAYEAaTFWjK/LFzOo+0TWqTTj4WC4N3I8JFrHnlqFJlpchYTW2z92SU1G
iEzFjWzuDNjp5KM9BqlmGtzXZvy6MItGkYsjPRdPVU0rbCmyTho6y77kTyiEG12V
UAJ1in3FOQfDwLPcp7wQRgCQq3iZlv7pwXp2Lm5fzu8kZPnxmTVdiKQun9Ps7uKq
BoM0fM2K14MxVO4Wc0SERnaPszE7xAhkIcs+NRT/gHYdTBlPhao83S3LOOdtCqCP
pNUOEaShlwI5bVsDPUXNX/eS0MYFNlsYTb5rCxK8jf3W3KNjKTOzN94pHiQOhpkg
xMPPi3m03/9oKTVXBtHI2A+u3ukheKE6sBXCLdv/GEs9zYI49zmpQxNWz5EOumWL
k+W/vPv7cD6LeHxxp+nCbEJi1gZtYb3gMY1sLkMNxcOu0QHTqHfme+k7VKWm8anO
3ogGdGtPuPAD/qjMwg3ChSDLl5Ur/E9UPlD4yM/7KtUD7mLv+jbddA62EiA9MxVB
t+yt7pOwOA66
-----END CERTIFICATE-----`

module.exports = { key, cert }
2 changes: 1 addition & 1 deletion test/h2c-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { once } = require('node:events')
const { test } = require('node:test')

const { tspl } = require('@matteo.collina/tspl')
const pem = require('https-pem')
const pem = require('./fixtures/https-pem.js')

const { H2CClient } = require('..')

Expand Down
2 changes: 1 addition & 1 deletion test/http2.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { createReadStream, readFileSync } = require('node:fs')
const { once } = require('node:events')
const { Writable, pipeline, PassThrough, Readable } = require('node:stream')

const pem = require('https-pem')
const pem = require('./fixtures/https-pem.js')

const { Client, Agent, FormData } = require('..')

Expand Down
2 changes: 1 addition & 1 deletion test/https.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { tspl } = require('@matteo.collina/tspl')
const { test, after } = require('node:test')
const { Client } = require('..')
const { createServer } = require('node:https')
const pem = require('https-pem')
const pem = require('./fixtures/https-pem.js')

test('https get with tls opts', async (t) => {
t = tspl(t, { plan: 6 })
Expand Down
2 changes: 1 addition & 1 deletion test/interceptors/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { createServer: createSecureServer } = require('node:https')
const { once } = require('node:events')

const { tspl } = require('@matteo.collina/tspl')
const pem = require('https-pem')
const pem = require('../fixtures/https-pem.js')

const { interceptors, Agent } = require('../..')
const { dns } = interceptors
Expand Down
2 changes: 1 addition & 1 deletion test/node-test/ca-fingerprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const crypto = require('node:crypto')
const https = require('node:https')
const { test } = require('node:test')
const { Client, buildConnector } = require('../..')
const pem = require('https-pem')
const pem = require('../fixtures/https-pem.js')
const { tspl } = require('@matteo.collina/tspl')

const caFingerprint = getFingerprint(pem.cert.toString()
Expand Down
2 changes: 1 addition & 1 deletion test/node-test/client-dispatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const https = require('node:https')
const { Client, Pool, errors } = require('../..')
const stream = require('node:stream')
const { createSecureServer } = require('node:http2')
const pem = require('https-pem')
const pem = require('../fixtures/https-pem.js')
const { tspl } = require('@matteo.collina/tspl')
const { closeServerAsPromise, closeClientAndServerAsPromise } = require('../utils/node-http')

Expand Down
2 changes: 1 addition & 1 deletion test/node-test/client-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { Readable } = require('node:stream')
const { test, after } = require('node:test')
const { Client, Pool, errors } = require('../..')
const { createServer } = require('node:http')
const pem = require('https-pem')
const pem = require('../fixtures/https-pem.js')
const { tspl } = require('@matteo.collina/tspl')

const { kSocket } = require('../../lib/core/symbols')
Expand Down
2 changes: 1 addition & 1 deletion test/node-test/diagnostics-channel/get-h2.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { test, after } = require('node:test')
const { createSecureServer } = require('node:http2')
const diagnosticsChannel = require('node:diagnostics_channel')
const { once } = require('node:events')
const pem = require('https-pem')
const pem = require('../../fixtures/https-pem.js')
const { Client } = require('../../..')

test('Diagnostics channel - get support H2', async t => {
Expand Down
2 changes: 1 addition & 1 deletion test/node-test/unix.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const { test } = require('node:test')
const { Client, Pool } = require('../../')
const http = require('node:http')
const https = require('node:https')
const pem = require('https-pem')
const fs = require('node:fs')
const { tspl } = require('@matteo.collina/tspl')
const pem = require('../fixtures/https-pem.js')

const skip = process.platform === 'win32'

Expand Down
Loading