@@ -1444,6 +1444,33 @@ describe('raven.Client', function() {
1444
1444
} ) ;
1445
1445
} ) ;
1446
1446
1447
+ it ( 'should instrument http and log non-standard http (:80) port' , function ( done ) {
1448
+ var testUrl = 'http://example.com:1337/' ;
1449
+ var scope = nock ( testUrl )
1450
+ . get ( '/' )
1451
+ . reply ( 200 , 'OK' ) ;
1452
+
1453
+ client . context ( function ( ) {
1454
+ var http = require ( 'http' ) ;
1455
+ http . get ( url . parse ( testUrl ) , function ( response ) {
1456
+ response . _readableState . should . have . property ( 'flowing' , initialFlowingState ) ;
1457
+ // need to wait a tick here because nock will make this callback fire
1458
+ // before our req.emit monkeypatch captures the breadcrumb :/
1459
+ setTimeout ( function ( ) {
1460
+ response . _readableState . should . have . property (
1461
+ 'flowing' ,
1462
+ initialFlowingState
1463
+ ) ;
1464
+ client . getContext ( ) . breadcrumbs [ 0 ] . data . url . should . equal ( testUrl ) ;
1465
+ client . getContext ( ) . breadcrumbs [ 0 ] . data . status_code . should . equal ( 200 ) ;
1466
+ client . getContext ( ) . breadcrumbs . length . should . equal ( 1 ) ;
1467
+ scope . done ( ) ;
1468
+ done ( ) ;
1469
+ } , 0 ) ;
1470
+ } ) ;
1471
+ } ) ;
1472
+ } ) ;
1473
+
1447
1474
it ( 'should instrument https to capture breadcrumbs' , function ( done ) {
1448
1475
var testUrl = 'https://example.com/' ;
1449
1476
var scope = nock ( testUrl )
@@ -1487,6 +1514,32 @@ describe('raven.Client', function() {
1487
1514
} ) ;
1488
1515
} ) ;
1489
1516
} ) ;
1517
+
1518
+ it ( 'should instrument https and log non-standard https (:443) port' , function ( done ) {
1519
+ var testUrl = 'https://example.com:1337/' ;
1520
+ var scope = nock ( testUrl )
1521
+ . get ( '/' )
1522
+ . reply ( 200 , 'OK' ) ;
1523
+
1524
+ client . context ( function ( ) {
1525
+ var https = require ( 'https' ) ;
1526
+ https . get ( url . parse ( testUrl ) , function ( response ) {
1527
+ response . _readableState . should . have . property ( 'flowing' , initialFlowingState ) ;
1528
+ // need to wait a tick here because nock will make this callback fire
1529
+ // before our req.emit monkeypatch captures the breadcrumb :/
1530
+ setTimeout ( function ( ) {
1531
+ response . _readableState . should . have . property (
1532
+ 'flowing' ,
1533
+ initialFlowingState
1534
+ ) ;
1535
+ client . getContext ( ) . breadcrumbs [ 0 ] . data . url . should . equal ( testUrl ) ;
1536
+ client . getContext ( ) . breadcrumbs [ 0 ] . data . status_code . should . equal ( 200 ) ;
1537
+ scope . done ( ) ;
1538
+ done ( ) ;
1539
+ } , 0 ) ;
1540
+ } ) ;
1541
+ } ) ;
1542
+ } ) ;
1490
1543
} ) ;
1491
1544
} ) ;
1492
1545
0 commit comments