node-digest-auth
Advanced tools
+1
-1
| { | ||
| "name": "node-digest-auth", | ||
| "version": "1.0.2", | ||
| "version": "1.0.3", | ||
| "description": "Digest Auth Package", | ||
@@ -5,0 +5,0 @@ "main": "dist/digestClient.js", |
@@ -27,2 +27,3 @@ import * as crypto from "crypto"; | ||
| private httpRequest: typeof http | typeof https; | ||
| private authenticatedSocket: any | null = null; // Add this line | ||
@@ -52,5 +53,5 @@ constructor( | ||
| // Listen for the socket event to capture the underlying socket | ||
| let socket: any = null; | ||
| let initialSocket: any = null; | ||
| req.on("socket", (sock: any) => { | ||
| socket = sock; | ||
| initialSocket = sock; | ||
| }); | ||
@@ -66,3 +67,3 @@ | ||
| request: req, | ||
| getSocket: () => socket, | ||
| getSocket: () => this.authenticatedSocket || initialSocket, // Prefer the authenticated socket if available | ||
| }; | ||
@@ -130,2 +131,7 @@ } | ||
| // Capture the authenticated socket | ||
| req.on("socket", (sock: any) => { | ||
| this.authenticatedSocket = sock; | ||
| }); | ||
| if (this.shouldEnd) { | ||
@@ -132,0 +138,0 @@ req.end(); |
13528
2.16%316
1.61%