Skip to content

Commit 0ca55d7

Browse files
committed
Merge pr TooTallNate#46 with minor change
1 parent a015873 commit 0ca55d7

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/parse-proxy-response.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ export default function parseProxyResponse(
3434

3535
function onclose(err?: Error) {
3636
debug('onclose had error %o', err);
37+
reject(err);
3738
}
3839

3940
function onend() {
4041
debug('onend');
42+
reject(new Error('Socket was closed by other party!'));
4143
}
4244

4345
function onerror(err: Error) {

test/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ describe('HttpsProxyAgent', function() {
343343
opts.port = 80;
344344
opts.agent = agent;
345345

346-
http.get(opts);
346+
let = req = http.get(opts);
347+
req.once('error', function(err) {});
347348
});
348349
});
349350

0 commit comments

Comments
 (0)