Skip to content

Commit

Permalink
Mark __httpPeekedData type as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Dec 6, 2023
1 parent 4239d93 commit 92eaae3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import { EventEmitter } from 'events';

declare module 'net' {
interface Socket {
/**
* Only preserved for types backward compat - always undefined in new releases.
*
* @deprecated
*/
__httpPeekedData?: Buffer;
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/http.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe("HTTP", () => {
throw new Error("Request handler should not be called");
});

const serverErrorPromise = new Promise<any>((resolve) => {
const serverErrorPromise = new Promise<[any, net.Socket]>((resolve) => {
// Multiple errors will be fired - we want to check the data from the final
// error (which will contain the whole packet)
let lastResult: any;
Expand Down
2 changes: 1 addition & 1 deletion test/http2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe("HTTP/2", () => {
throw new Error("Request handler should not be called");
});

const serverErrorPromise = new Promise<any>((resolve) => {
const serverErrorPromise = new Promise<[any, net.Socket]>((resolve) => {
// Multiple errors will be fired - we want to check the data from the final
// error (which will contain the whole packet)
let lastResult: any;
Expand Down
2 changes: 1 addition & 1 deletion test/https.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe("HTTPS", () => {
throw new Error("Request handler should not be called");
});

const serverErrorPromise = new Promise<any>((resolve) => {
const serverErrorPromise = new Promise<[any, net.Socket]>((resolve) => {
// Multiple errors will be fired - we want to check the data from the final
// error (which will contain the whole packet)
let lastResult: any;
Expand Down

0 comments on commit 92eaae3

Please sign in to comment.