@@ -153,13 +153,20 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
153
153
var uri = url . format ( {
154
154
protocol : this . protocol ,
155
155
hostname : this . host ,
156
- auth : this . username + ':' + this . password ,
157
156
port : this . port ,
158
157
pathname : basePath + this . apiVersion + pathname
159
158
} ) ;
160
159
return decodeURIComponent ( uri ) ;
161
160
} ;
162
161
162
+ this . doRequest = function ( options , callback ) {
163
+ options . auth = {
164
+ 'user' : this . username ,
165
+ 'pass' : this . password
166
+ } ;
167
+
168
+ this . request ( options , callback ) ;
169
+ } ;
163
170
164
171
} ;
165
172
@@ -184,7 +191,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
184
191
method : 'GET'
185
192
} ;
186
193
187
- this . request ( options , function ( error , response , body ) {
194
+ this . doRequest ( options , function ( error , response , body ) {
188
195
189
196
if ( error ) {
190
197
callback ( error , null ) ;
@@ -229,7 +236,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
229
236
method : 'GET'
230
237
} ;
231
238
232
- this . request ( options , function ( error , response , body ) {
239
+ this . doRequest ( options , function ( error , response , body ) {
233
240
234
241
if ( error ) {
235
242
callback ( error , null ) ;
@@ -272,7 +279,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
272
279
method : 'GET'
273
280
} ;
274
281
275
- this . request ( options , function ( error , response , body ) {
282
+ this . doRequest ( options , function ( error , response , body ) {
276
283
277
284
if ( error ) {
278
285
callback ( error , null ) ;
@@ -320,7 +327,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
320
327
json : true
321
328
} ;
322
329
323
- this . request ( options , function ( error , response ) {
330
+ this . doRequest ( options , function ( error , response ) {
324
331
325
332
if ( error ) {
326
333
callback ( error , null ) ;
@@ -375,7 +382,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
375
382
json :true
376
383
} ;
377
384
378
- this . request ( options , function ( error , response ) {
385
+ this . doRequest ( options , function ( error , response ) {
379
386
380
387
if ( error ) {
381
388
callback ( error , null ) ;
@@ -428,7 +435,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
428
435
json : true
429
436
} ;
430
437
431
- this . request ( options , function ( error , response ) {
438
+ this . doRequest ( options , function ( error , response ) {
432
439
433
440
if ( error ) {
434
441
callback ( error , null ) ;
@@ -490,7 +497,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
490
497
491
498
logger . log ( options . uri ) ;
492
499
493
- this . request ( options , function ( error , response ) {
500
+ this . doRequest ( options , function ( error , response ) {
494
501
495
502
if ( error ) {
496
503
callback ( error , null ) ;
@@ -551,7 +558,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
551
558
body : link
552
559
} ;
553
560
554
- this . request ( options , function ( error , response ) {
561
+ this . doRequest ( options , function ( error , response ) {
555
562
556
563
if ( error ) {
557
564
callback ( error , null ) ;
@@ -592,7 +599,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
592
599
method : 'GET'
593
600
} ;
594
601
595
- this . request ( options , function ( error , response , body ) {
602
+ this . doRequest ( options , function ( error , response , body ) {
596
603
597
604
if ( error ) {
598
605
callback ( error , null ) ;
@@ -648,7 +655,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
648
655
json : true ,
649
656
body : version
650
657
} ;
651
- this . request ( options , function ( error , response , body ) {
658
+ this . doRequest ( options , function ( error , response , body ) {
652
659
653
660
if ( error ) {
654
661
callback ( error , null ) ;
@@ -717,7 +724,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
717
724
}
718
725
} ;
719
726
720
- this . request ( options , function ( error , response , body ) {
727
+ this . doRequest ( options , function ( error , response , body ) {
721
728
722
729
if ( error ) {
723
730
callback ( error , null ) ;
@@ -775,7 +782,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
775
782
followAllRedirects : true
776
783
} ;
777
784
778
- this . request ( options , function ( error , response , body ) {
785
+ this . doRequest ( options , function ( error , response , body ) {
779
786
780
787
if ( error ) {
781
788
callback ( error , null ) ;
@@ -839,7 +846,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
839
846
body : issue
840
847
} ;
841
848
842
- this . request ( options , function ( error , response , body ) {
849
+ this . doRequest ( options , function ( error , response , body ) {
843
850
844
851
if ( error ) {
845
852
callback ( error , null ) ;
@@ -880,7 +887,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
880
887
json : true
881
888
} ;
882
889
883
- this . request ( options , function ( error , response ) {
890
+ this . doRequest ( options , function ( error , response ) {
884
891
885
892
if ( error ) {
886
893
callback ( error , null ) ;
@@ -918,7 +925,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
918
925
json : true
919
926
} ;
920
927
921
- this . request ( options , function ( error , response ) {
928
+ this . doRequest ( options , function ( error , response ) {
922
929
923
930
if ( error ) {
924
931
callback ( error , null ) ;
@@ -977,7 +984,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
977
984
json : true
978
985
} ;
979
986
980
- this . request ( options , function ( error , response , body ) {
987
+ this . doRequest ( options , function ( error , response , body ) {
981
988
982
989
if ( error ) {
983
990
callback ( error , null ) ;
@@ -1030,7 +1037,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1030
1037
json : true
1031
1038
} ;
1032
1039
1033
- this . request ( options , function ( error , response , body ) {
1040
+ this . doRequest ( options , function ( error , response , body ) {
1034
1041
1035
1042
if ( error ) {
1036
1043
callback ( error , null ) ;
@@ -1078,7 +1085,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1078
1085
json : true
1079
1086
} ;
1080
1087
1081
- this . request ( options , function ( error , response , body ) {
1088
+ this . doRequest ( options , function ( error , response , body ) {
1082
1089
1083
1090
if ( error ) {
1084
1091
callback ( error , null ) ;
@@ -1155,7 +1162,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1155
1162
json : true
1156
1163
} ;
1157
1164
1158
- this . request ( options , function ( error , response , body ) {
1165
+ this . doRequest ( options , function ( error , response , body ) {
1159
1166
1160
1167
if ( error ) {
1161
1168
callback ( error , null ) ;
@@ -1197,7 +1204,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1197
1204
json : true
1198
1205
} ;
1199
1206
1200
- this . request ( options , function ( error , response ) {
1207
+ this . doRequest ( options , function ( error , response ) {
1201
1208
1202
1209
if ( error ) {
1203
1210
callback ( error , null ) ;
@@ -1245,7 +1252,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1245
1252
json : true
1246
1253
} ;
1247
1254
1248
- this . request ( options , function ( error , response , body ) {
1255
+ this . doRequest ( options , function ( error , response , body ) {
1249
1256
1250
1257
if ( error ) {
1251
1258
callback ( error , null ) ;
@@ -1288,7 +1295,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1288
1295
json : true
1289
1296
} ;
1290
1297
1291
- this . request ( options , function ( error , response , body ) {
1298
+ this . doRequest ( options , function ( error , response , body ) {
1292
1299
if ( error ) {
1293
1300
callback ( error , null ) ;
1294
1301
return ;
@@ -1353,7 +1360,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1353
1360
json : true
1354
1361
} ;
1355
1362
1356
- this . request ( options , function ( error , response , body ) {
1363
+ this . doRequest ( options , function ( error , response , body ) {
1357
1364
1358
1365
if ( error ) {
1359
1366
callback ( error , null ) ;
@@ -1406,7 +1413,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1406
1413
json : true
1407
1414
} ;
1408
1415
1409
- this . request ( options , function ( error , response , body ) {
1416
+ this . doRequest ( options , function ( error , response , body ) {
1410
1417
1411
1418
if ( error ) {
1412
1419
callback ( error , null ) ;
0 commit comments