Skip to content
Merged
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"devDependencies": {
"@fastify/busboy": "3.1.1",
"@matteo.collina/tspl": "^0.2.0",
"@metcoder95/https-pem": "^1.0.0",
"@sinonjs/fake-timers": "^12.0.0",
"@types/node": "^18.19.50",
"abort-controller": "^3.0.0",
Expand All @@ -119,7 +120,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
2 changes: 1 addition & 1 deletion scripts/generate-pem.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'
/* istanbul ignore file */

require('https-pem/install')
require('@metcoder95/https-pem/install')
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,7 +4,7 @@ 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 pem = require('@metcoder95/https-pem')
const tls = require('node:tls')

test('custom session passed to client will be used in tls connect call', async (t) => {
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,7 +7,7 @@ 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 pem = require('@metcoder95/https-pem')
const { createSecureServer } = require('node:http2')
const { closeClientAndServerAsPromise } = require('../utils/node-http')

Expand Down
20 changes: 10 additions & 10 deletions 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('@metcoder95/https-pem')

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

Expand All @@ -16,7 +16,7 @@ const { closeClientAndServerAsPromise } = require('../utils/node-http')
test('[Fetch] Issue#2311', async (t) => {
const expectedBody = 'hello from client!'

const server = createSecureServer(pem, async (req, res) => {
const server = createSecureServer(await pem.generate({ opts: { keySize: 2048 } }), async (req, res) => {
let body = ''

req.setEncoding('utf8')
Expand Down Expand Up @@ -68,7 +68,7 @@ test('[Fetch] Issue#2311', async (t) => {
})

test('[Fetch] Simple GET with h2', async (t) => {
const server = createSecureServer(pem)
const server = createSecureServer(await pem.generate({ opts: { keySize: 2048 } }))
const expectedRequestBody = 'hello h2!'

server.on('stream', async (stream, headers) => {
Expand Down Expand Up @@ -124,7 +124,7 @@ test('[Fetch] Simple GET with h2', async (t) => {
})

test('[Fetch] Should handle h2 request with body (string or buffer)', async (t) => {
const server = createSecureServer(pem)
const server = createSecureServer(await pem.generate({ opts: { keySize: 2048 } }))
const expectedBody = 'hello from client!'
const expectedRequestBody = 'hello h2!'
const requestBody = []
Expand Down Expand Up @@ -179,7 +179,7 @@ test('[Fetch] Should handle h2 request with body (string or buffer)', async (t)
test(
'[Fetch] Should handle h2 request with body (stream)',
async (t) => {
const server = createSecureServer(pem)
const server = createSecureServer(await pem.generate({ opts: { keySize: 2048 } }))
const expectedBody = readFileSync(__filename, 'utf-8')
const stream = createReadStream(__filename)
const requestChunks = []
Expand Down Expand Up @@ -241,7 +241,7 @@ test(
}
)
test('Should handle h2 request with body (Blob)', { skip: !Blob }, async (t) => {
const server = createSecureServer(pem)
const server = createSecureServer(await pem.generate({ opts: { keySize: 2048 } }))
const expectedBody = 'asd'
const requestChunks = []
const body = new Blob(['asd'], {
Expand Down Expand Up @@ -305,7 +305,7 @@ test(
'Should handle h2 request with body (Blob:ArrayBuffer)',
{ skip: !Blob },
async (t) => {
const server = createSecureServer(pem)
const server = createSecureServer(await pem.generate({ opts: { keySize: 2048 } }))
const expectedBody = 'hello'
const requestChunks = []
const expectedResponseBody = { hello: 'h2' }
Expand Down Expand Up @@ -370,7 +370,7 @@ test(

test('Issue#2415', async (t) => {
const { doesNotThrow } = tspl(t, { plan: 1 })
const server = createSecureServer(pem)
const server = createSecureServer(await pem.generate({ opts: { keySize: 2048 } }))

server.on('stream', async (stream, headers) => {
stream.respond({
Expand Down Expand Up @@ -406,7 +406,7 @@ test('Issue#2415', async (t) => {
})

test('Issue #2386', async (t) => {
const server = createSecureServer(pem)
const server = createSecureServer(await pem.generate({ opts: { keySize: 2048 } }))
const body = Buffer.from('hello')
const requestChunks = []
const expectedResponseBody = { hello: 'h2' }
Expand Down Expand Up @@ -463,7 +463,7 @@ test('Issue #2386', async (t) => {
})

test('Issue #3046', async (t) => {
const server = createSecureServer(pem)
const server = createSecureServer(await pem.generate({ opts: { keySize: 2048 } }))

const { strictEqual, deepStrictEqual } = tspl(t, { plan: 6 })

Expand Down
4 changes: 2 additions & 2 deletions 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('@metcoder95/https-pem')

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

Expand Down Expand Up @@ -101,7 +101,7 @@ test('Should support h2c connection', async t => {
test('Should reject request if not h2c supported', async t => {
const planner = tspl(t, { plan: 1 })

const server = createSecureServer(pem, (req, res) => {
const server = createSecureServer(await pem.generate({ opts: { keySize: 2048 } }), (req, res) => {
res.writeHead(200)
res.end('Hello, world!')
})
Expand Down
Loading
Loading