Socket
Socket
Sign inDemoInstall

undici

Package Overview
Dependencies
Maintainers
2
Versions
212
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

undici - npm Package Compare versions

Comparing version 4.0.0-rc.7 to 4.0.0-rc.8

2

docs/api/Dispatcher.md

@@ -399,2 +399,4 @@ # Dispatcher

All response bodies must always be fully consumed or destroyed.
Arguments:

@@ -401,0 +403,0 @@

26

docs/api/Errors.md

@@ -10,14 +10,14 @@ # Errors

| Error | Error Codes | Description |
| ------------------------------------|---------------------------------------|----------------------------------------------------|
| `InvalidArgumentError` | `UND_ERR_INVALID_ARG` | passed an invalid argument. |
| `InvalidReturnValueError` | `UND_ERR_INVALID_RETURN_VALUE` | returned an invalid value. |
| `RequestAbortedError` | `UND_ERR_ABORTED` | the request has been aborted by the user |
| `ClientDestroyedError` | `UND_ERR_DESTROYED` | trying to use a destroyed client. |
| `ClientClosedError` | `UND_ERR_CLOSED` | trying to use a closed client. |
| `SocketError` | `UND_ERR_SOCKET` | there is an error with the socket. |
| `NotSupportedError` | `UND_ERR_NOT_SUPPORTED` | encountered unsupported functionality. |
| `RequestContentLengthMismatchError` | `UND_ERR_REQ_CONTENT_LENGTH_MISMATCH`| request body does not match content-length header |
| `RequestContentLengthMismatchError` | `UND_ERR_RES_CONTENT_LENGTH_MISMATCH`| response body does not match content-length header |
| `InformationalError` | `UND_ERR_INFO` | expected error with reason |
| `TrailerMismatchError` | `UND_ERR_TRAILER_MISMATCH` | trailers did not match specification |
| Error | Error Codes | Description |
| ------------------------------------ | ------------------------------------- | -------------------------------------------------- |
| `InvalidArgumentError` | `UND_ERR_INVALID_ARG` | passed an invalid argument. |
| `InvalidReturnValueError` | `UND_ERR_INVALID_RETURN_VALUE` | returned an invalid value. |
| `RequestAbortedError` | `UND_ERR_ABORTED` | the request has been aborted by the user |
| `ClientDestroyedError` | `UND_ERR_DESTROYED` | trying to use a destroyed client. |
| `ClientClosedError` | `UND_ERR_CLOSED` | trying to use a closed client. |
| `SocketError` | `UND_ERR_SOCKET` | there is an error with the socket. |
| `NotSupportedError` | `UND_ERR_NOT_SUPPORTED` | encountered unsupported functionality. |
| `RequestContentLengthMismatchError` | `UND_ERR_REQ_CONTENT_LENGTH_MISMATCH` | request body does not match content-length header |
| `ResponseContentLengthMismatchError` | `UND_ERR_RES_CONTENT_LENGTH_MISMATCH` | response body does not match content-length header |
| `InformationalError` | `UND_ERR_INFO` | expected error with reason |
| `TrailerMismatchError` | `UND_ERR_TRAILER_MISMATCH` | trailers did not match specification |

@@ -1523,4 +1523,3 @@ 'use strict'

assert.strictEqual(socket[kParser].timeoutType, TIMEOUT_HEADERS)
if (socket[kParser].timeout) {
if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {
// istanbul ignore else: only for jest

@@ -1527,0 +1526,0 @@ if (socket[kParser].timeout.refresh) {

@@ -133,5 +133,7 @@ 'use strict'

if (typeof stream.destroy === 'function') {
if (err || Object.getPrototypeOf(stream).constructor !== IncomingMessage) {
stream.destroy(err)
if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
// See: https://github.com/nodejs/node/pull/38505/files
stream.socket = null
}
stream.destroy(err)
} else if (err) {

@@ -138,0 +140,0 @@ process.nextTick((stream, err) => {

{
"name": "undici",
"version": "4.0.0-rc.7",
"version": "4.0.0-rc.8",
"description": "An HTTP/1.1 client, written from scratch for Node.js",

@@ -5,0 +5,0 @@ "homepage": "https://undici.nodejs.org",

import Agent from './agent'
import Dispatcher from './dispatcher'
import { Interceptable } from './mock-interceptor'

@@ -10,5 +11,5 @@ export = MockAgent

/** Creates and retrieves mock Dispatcher instances which can then be used to intercept HTTP requests. If the number of connections on the mock agent is set to 1, a MockClient instance is returned. Otherwise a MockPool instance is returned. */
get<TDispatcher extends Dispatcher>(origin: string): TDispatcher;
get<TDispatcher extends Dispatcher>(origin: RegExp): TDispatcher;
get<TDispatcher extends Dispatcher>(origin: ((origin: string) => boolean)): TDispatcher;
get<TInterceptable extends Interceptable>(origin: string): TInterceptable;
get<TInterceptable extends Interceptable>(origin: RegExp): TInterceptable;
get<TInterceptable extends Interceptable>(origin: ((origin: string) => boolean)): TInterceptable;
/** Dispatches a mocked request. */

@@ -15,0 +16,0 @@ dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): void;

import Client from './client'
import Dispatcher from './dispatcher'
import MockAgent from './mock-agent'
import { MockInterceptor } from './mock-interceptor'
import { MockInterceptor, Interceptable } from './mock-interceptor'

@@ -9,3 +9,3 @@ export = MockClient

/** MockClient extends the Client API and allows one to mock requests. */
declare class MockClient extends Client {
declare class MockClient extends Client implements Interceptable {
constructor(origin: string, options: MockClient.Options);

@@ -12,0 +12,0 @@ /** Intercepts any matching requests that use the same origin as this mock client. */

import { IncomingHttpHeaders } from 'http'
export {
Interceptable,
MockInterceptor,

@@ -62,1 +63,6 @@ MockScope

}
interface Interceptable {
/** Intercepts any matching requests that use the same origin as this mock client. */
intercept(options: MockInterceptor.Options): MockInterceptor;
}
import Pool from './pool'
import MockAgent from './mock-agent'
import { MockInterceptor } from './mock-interceptor'
import { Interceptable, MockInterceptor } from './mock-interceptor'
import Dispatcher from './dispatcher'

@@ -9,3 +9,3 @@

/** MockPool extends the Pool API and allows one to mock requests. */
declare class MockPool extends Pool {
declare class MockPool extends Pool implements Interceptable {
constructor(origin: string, options: MockPool.Options);

@@ -12,0 +12,0 @@ /** Intercepts any matching requests that use the same origin as this mock pool. */

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