File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ SwaggerClient.prototype.initialize = function (url, options) {
136136 this . defaultSuccessCallback = options . defaultSuccessCallback || null ;
137137 this . defaultErrorCallback = options . defaultErrorCallback || null ;
138138 this . modelPropertyMacro = options . modelPropertyMacro || null ;
139+ this . connectionAgent = options . connectionAgent || null ;
139140 this . parameterMacro = options . parameterMacro || null ;
140141 this . usePromise = options . usePromise || null ;
141142
@@ -201,6 +202,7 @@ SwaggerClient.prototype.build = function (mock) {
201202 var obj = {
202203 useJQuery : this . useJQuery ,
203204 jqueryAjaxCache : this . jqueryAjaxCache ,
205+ connectionAgent : this . connectionAgent ,
204206 url : this . url ,
205207 method : 'get' ,
206208 headers : {
Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ JQueryHttpClient.prototype.execute = function (obj) {
207207} ;
208208
209209SuperagentHttpClient . prototype . execute = function ( obj ) {
210+ var connectionAgent = obj . connectionAgent ;
210211 var method = obj . method . toLowerCase ( ) ;
211212 var timeout = obj . timeout ;
212213
@@ -216,6 +217,10 @@ SuperagentHttpClient.prototype.execute = function (obj) {
216217 var headers = obj . headers || { } ;
217218 var r = request [ method ] ( obj . url ) ;
218219
220+ if ( connectionAgent ) {
221+ r . agent ( connectionAgent ) ;
222+ }
223+
219224 if ( timeout ) {
220225 r . timeout ( timeout ) ;
221226 }
You can’t perform that action at this time.
0 commit comments