@@ -158,13 +158,20 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
158
158
var uri = url . format ( {
159
159
protocol : this . protocol ,
160
160
hostname : this . host ,
161
- auth : this . username + ':' + this . password ,
162
161
port : this . port ,
163
162
pathname : basePath + apiVersion + pathname
164
163
} ) ;
165
164
return decodeURIComponent ( uri ) ;
166
165
} ;
167
166
167
+ this . doRequest = function ( options , callback ) {
168
+ options . auth = {
169
+ 'user' : this . username ,
170
+ 'pass' : this . password
171
+ } ;
172
+
173
+ this . request ( options , callback ) ;
174
+ } ;
168
175
169
176
} ;
170
177
@@ -189,7 +196,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
189
196
method : 'GET'
190
197
} ;
191
198
192
- this . request ( options , function ( error , response , body ) {
199
+ this . doRequest ( options , function ( error , response , body ) {
193
200
194
201
if ( error ) {
195
202
callback ( error , null ) ;
@@ -234,7 +241,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
234
241
method : 'GET'
235
242
} ;
236
243
237
- this . request ( options , function ( error , response , body ) {
244
+ this . doRequest ( options , function ( error , response , body ) {
238
245
239
246
if ( error ) {
240
247
callback ( error , null ) ;
@@ -277,7 +284,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
277
284
method : 'GET'
278
285
} ;
279
286
280
- this . request ( options , function ( error , response , body ) {
287
+ this . doRequest ( options , function ( error , response , body ) {
281
288
282
289
if ( error ) {
283
290
callback ( error , null ) ;
@@ -325,7 +332,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
325
332
json : true
326
333
} ;
327
334
328
- this . request ( options , function ( error , response ) {
335
+ this . doRequest ( options , function ( error , response ) {
329
336
330
337
if ( error ) {
331
338
callback ( error , null ) ;
@@ -380,7 +387,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
380
387
json :true
381
388
} ;
382
389
383
- this . request ( options , function ( error , response ) {
390
+ this . doRequest ( options , function ( error , response ) {
384
391
385
392
if ( error ) {
386
393
callback ( error , null ) ;
@@ -433,7 +440,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
433
440
json : true
434
441
} ;
435
442
436
- this . request ( options , function ( error , response ) {
443
+ this . doRequest ( options , function ( error , response ) {
437
444
438
445
if ( error ) {
439
446
callback ( error , null ) ;
@@ -495,7 +502,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
495
502
496
503
logger . log ( options . uri ) ;
497
504
498
- this . request ( options , function ( error , response ) {
505
+ this . doRequest ( options , function ( error , response ) {
499
506
500
507
if ( error ) {
501
508
callback ( error , null ) ;
@@ -556,7 +563,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
556
563
body : link
557
564
} ;
558
565
559
- this . request ( options , function ( error , response ) {
566
+ this . doRequest ( options , function ( error , response ) {
560
567
561
568
if ( error ) {
562
569
callback ( error , null ) ;
@@ -597,7 +604,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
597
604
method : 'GET'
598
605
} ;
599
606
600
- this . request ( options , function ( error , response , body ) {
607
+ this . doRequest ( options , function ( error , response , body ) {
601
608
602
609
if ( error ) {
603
610
callback ( error , null ) ;
@@ -653,7 +660,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
653
660
json : true ,
654
661
body : version
655
662
} ;
656
- this . request ( options , function ( error , response , body ) {
663
+ this . doRequest ( options , function ( error , response , body ) {
657
664
658
665
if ( error ) {
659
666
callback ( error , null ) ;
@@ -722,7 +729,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
722
729
}
723
730
} ;
724
731
725
- this . request ( options , function ( error , response , body ) {
732
+ this . doRequest ( options , function ( error , response , body ) {
726
733
727
734
if ( error ) {
728
735
callback ( error , null ) ;
@@ -780,7 +787,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
780
787
followAllRedirects : true
781
788
} ;
782
789
783
- this . request ( options , function ( error , response , body ) {
790
+ this . doRequest ( options , function ( error , response , body ) {
784
791
785
792
if ( error ) {
786
793
callback ( error , null ) ;
@@ -844,7 +851,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
844
851
body : issue
845
852
} ;
846
853
847
- this . request ( options , function ( error , response , body ) {
854
+ this . doRequest ( options , function ( error , response , body ) {
848
855
849
856
if ( error ) {
850
857
callback ( error , null ) ;
@@ -885,7 +892,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
885
892
json : true
886
893
} ;
887
894
888
- this . request ( options , function ( error , response ) {
895
+ this . doRequest ( options , function ( error , response ) {
889
896
890
897
if ( error ) {
891
898
callback ( error , null ) ;
@@ -923,7 +930,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
923
930
json : true
924
931
} ;
925
932
926
- this . request ( options , function ( error , response ) {
933
+ this . doRequest ( options , function ( error , response ) {
927
934
928
935
if ( error ) {
929
936
callback ( error , null ) ;
@@ -982,7 +989,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
982
989
json : true
983
990
} ;
984
991
985
- this . request ( options , function ( error , response , body ) {
992
+ this . doRequest ( options , function ( error , response , body ) {
986
993
987
994
if ( error ) {
988
995
callback ( error , null ) ;
@@ -1035,7 +1042,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1035
1042
json : true
1036
1043
} ;
1037
1044
1038
- this . request ( options , function ( error , response , body ) {
1045
+ this . doRequest ( options , function ( error , response , body ) {
1039
1046
1040
1047
if ( error ) {
1041
1048
callback ( error , null ) ;
@@ -1083,7 +1090,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1083
1090
json : true
1084
1091
} ;
1085
1092
1086
- this . request ( options , function ( error , response , body ) {
1093
+ this . doRequest ( options , function ( error , response , body ) {
1087
1094
1088
1095
if ( error ) {
1089
1096
callback ( error , null ) ;
@@ -1160,7 +1167,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1160
1167
json : true
1161
1168
} ;
1162
1169
1163
- this . request ( options , function ( error , response , body ) {
1170
+ this . doRequest ( options , function ( error , response , body ) {
1164
1171
1165
1172
if ( error ) {
1166
1173
callback ( error , null ) ;
@@ -1202,7 +1209,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1202
1209
json : true
1203
1210
} ;
1204
1211
1205
- this . request ( options , function ( error , response ) {
1212
+ this . doRequest ( options , function ( error , response ) {
1206
1213
1207
1214
if ( error ) {
1208
1215
callback ( error , null ) ;
@@ -1250,7 +1257,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1250
1257
json : true
1251
1258
} ;
1252
1259
1253
- this . request ( options , function ( error , response , body ) {
1260
+ this . doRequest ( options , function ( error , response , body ) {
1254
1261
1255
1262
if ( error ) {
1256
1263
callback ( error , null ) ;
@@ -1293,7 +1300,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1293
1300
json : true
1294
1301
} ;
1295
1302
1296
- this . request ( options , function ( error , response , body ) {
1303
+ this . doRequest ( options , function ( error , response , body ) {
1297
1304
if ( error ) {
1298
1305
callback ( error , null ) ;
1299
1306
return ;
@@ -1358,7 +1365,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1358
1365
json : true
1359
1366
} ;
1360
1367
1361
- this . request ( options , function ( error , response , body ) {
1368
+ this . doRequest ( options , function ( error , response , body ) {
1362
1369
1363
1370
if ( error ) {
1364
1371
callback ( error , null ) ;
@@ -1411,7 +1418,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1411
1418
json : true
1412
1419
} ;
1413
1420
1414
- this . request ( options , function ( error , response , body ) {
1421
+ this . doRequest ( options , function ( error , response , body ) {
1415
1422
1416
1423
if ( error ) {
1417
1424
callback ( error , null ) ;
0 commit comments