File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 4545 - Surface error types
4646
47476.0.0 Sept, 2023
48- - Force all requests to go through HTTPS
48+ - Force all requests to go through HTTPS
49+
50+ 7.0.0 Map, 2025
51+ - Added Node 22 support
52+ - Improved Disputes PUT request socket handling
Original file line number Diff line number Diff line change @@ -58,15 +58,15 @@ module.exports = class ApiRequestor {
5858 path : requestUrl . pathname + requestUrl . search ,
5959 method : spec . method . toUpperCase ( ) ,
6060 headers : this . getHeaders ( ! ! spec . data ) ,
61- auth : `${ this . getApiKey ( ) } :`
61+ auth : `${ this . getApiKey ( ) } :` ,
62+ rejectUnauthorized : true
6263 }
6364
6465 if ( this . _chargehound . options . port ) {
6566 reqOpts . port = this . _chargehound . options . port
6667 }
6768
6869 const req = https . request ( reqOpts ) . setTimeout ( this . getTimeout ( ) )
69- const connectEv = 'secureConnect'
7070
7171 req . on ( 'timeout' , function ( ) {
7272 req . abort ( )
@@ -77,14 +77,20 @@ module.exports = class ApiRequestor {
7777 } )
7878
7979 req . on ( 'socket' , function ( socket ) {
80- socket . on ( connectEv , function ( ) {
80+ socket . on ( 'connect' , function ( ) {
8181 if ( spec . data ) {
8282 req . write ( JSON . stringify ( spec . data ) )
8383 }
8484 req . end ( )
8585 } )
8686 } )
8787
88+ // Ensure the request is sent even if the event is not triggered
89+ if ( spec . data ) {
90+ req . write ( JSON . stringify ( spec . data ) )
91+ }
92+ req . end ( )
93+
8894 req . on ( 'response' , function ( res ) {
8995 let response = ''
9096
Original file line number Diff line number Diff line change 11{
22 "name" : " chargehound" ,
3- "version" : " 6 .0.0" ,
3+ "version" : " 7 .0.0" ,
44 "description" : " Automatically fight disputes" ,
55 "main" : " lib/index.js" ,
66 "engines" : {
You can’t perform that action at this time.
0 commit comments