Skip to content

Commit

Permalink
chore: set requestHeaderSent in _onRequestStart
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Sep 27, 2024
1 parent c3a6b62 commit 7949662
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/interceptors/ClientRequest/MockHttpSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ export class MockHttpSocket extends MockSocket {
constructor(options: MockHttpSocketOptions) {
super({
write: (chunk, encoding, callback) => {
// Mark the request header as sent once the
// socket receives its first write (which is the request header).
if (!this.requestHeaderSent) {
this.requestHeaderSent = true
}

this.writeBuffer.push([chunk, encoding, callback])

if (chunk) {
Expand Down Expand Up @@ -470,6 +464,7 @@ export class MockHttpSocket extends MockSocket {
}) {
const { path, headers, keepAlive } = args

this.requestHeaderSent = true
this.shouldKeepAlive = keepAlive

const method = this.connectionOptions.method?.toUpperCase() || 'GET'
Expand Down

0 comments on commit 7949662

Please sign in to comment.