advanced-tls-client 3.0.5 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -328,7 +328,6 @@ class UnifiedClientManager extends events_1.EventEmitter {
|
|
|
328
328
|
':path': normalizedPath,
|
|
329
329
|
...headers
|
|
330
330
|
};
|
|
331
|
-
console.log('Sending HTTP/2 Request Headers:', reqHeaders);
|
|
332
331
|
const stream = this.http2Client.request(reqHeaders);
|
|
333
332
|
const response = new events_1.EventEmitter();
|
|
334
333
|
response.timing = { socket: timingStart, lookup: 0, connect: 0, secureConnect: 0, response: 0, end: 0, total: 0 };
|
|
@@ -878,13 +877,15 @@ class AdvancedTLSClient {
|
|
|
878
877
|
}
|
|
879
878
|
}
|
|
880
879
|
const text = body.toString('utf-8');
|
|
881
|
-
let parsedJson;
|
|
880
|
+
let parsedJson = undefined;
|
|
882
881
|
const ct = headers['content-type']?.toLowerCase();
|
|
883
882
|
if (ct?.includes('application/json')) {
|
|
884
883
|
try {
|
|
885
884
|
parsedJson = JSON.parse(text);
|
|
886
885
|
}
|
|
887
|
-
catch {
|
|
886
|
+
catch (e) {
|
|
887
|
+
parsedJson = undefined;
|
|
888
|
+
}
|
|
888
889
|
}
|
|
889
890
|
resolve({
|
|
890
891
|
statusCode,
|