Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

undici-thread-interceptor

Package Overview
Dependencies
Maintainers
8
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

undici-thread-interceptor - npm Package Compare versions

Comparing version 0.10.0 to 0.10.1

test/fixtures/empty-headers.js

10

index.js

@@ -284,6 +284,14 @@ 'use strict'

const headers = {}
for (const [key, value] of Object.entries(opts.headers)) {
if (value !== undefined && value !== null) {
headers[key] = value
}
}
const injectOpts = {
method: opts.method,
url: opts.path,
headers: opts.headers,
headers,
query: opts.query,

@@ -290,0 +298,0 @@ body: opts.body instanceof Uint8Array ? Buffer.from(opts.body) : opts.body,

2

package.json
{
"name": "undici-thread-interceptor",
"version": "0.10.0",
"version": "0.10.1",
"description": "An Undici interceptor that routes requests over a worker thread",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -415,1 +415,21 @@ 'use strict'

})
test('empty header', async (t) => {
const worker = new Worker(join(__dirname, 'fixtures', 'empty-headers.js'))
t.after(() => worker.terminate())
const interceptor = createThreadInterceptor({
domain: '.local',
})
interceptor.route('myserver', worker)
const agent = new Agent().compose(interceptor)
const { statusCode, body } = await request('http://myserver.local', {
dispatcher: agent,
headers: { foo: undefined }
})
strictEqual(statusCode, 200)
deepStrictEqual(await body.text(), 'hello world')
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc