Skip to content

Commit 3acdb69

Browse files
authored
Update a comment
1 parent d0f2dfd commit 3acdb69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/request-as-event-emitter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ export default (options: NormalizedOptions) => {
143143

144144
const handleRequest = async (request: http.ClientRequest): Promise<void> => {
145145
// `request.aborted` is a boolean since v11.0.0: https://github.com/nodejs/node/commit/4b00c4fafaa2ae8c41c1f78823c0feb810ae4723#diff-e3bc37430eb078ccbafe3aa3b570c91a
146-
// We need to allow `TimedOutTimeoutError` here, because it `stream.pipeline(…)` aborts it automatically.
147146
const isAborted = () => typeof request.aborted === 'number' || (request.aborted as unknown as boolean) === true;
148147

149148
currentRequest = request;
@@ -162,6 +161,7 @@ export default (options: NormalizedOptions) => {
162161

163162
const attachErrorHandler = () => {
164163
request.once('error', error => {
164+
// We need to allow `TimedOutTimeoutError` here, because `stream.pipeline(…)` aborts the request automatically.
165165
if (isAborted() && !(error instanceof TimedOutTimeoutError)) {
166166
return;
167167
}

0 commit comments

Comments
 (0)