@@ -469,8 +469,10 @@ describe('SSEServerTransport', () => {
469
469
await transport . start ( ) ;
470
470
471
471
const mockReq = createMockRequest ( {
472
- host : 'localhost:3000' ,
473
- 'content-type' : 'application/json' ,
472
+ headers : {
473
+ host : 'localhost:3000' ,
474
+ 'content-type' : 'application/json' ,
475
+ }
474
476
} ) ;
475
477
const mockHandleRes = createMockResponse ( ) ;
476
478
@@ -489,8 +491,10 @@ describe('SSEServerTransport', () => {
489
491
await transport . start ( ) ;
490
492
491
493
const mockReq = createMockRequest ( {
492
- host : 'evil.com' ,
493
- 'content-type' : 'application/json' ,
494
+ headers : {
495
+ host : 'evil.com' ,
496
+ 'content-type' : 'application/json' ,
497
+ }
494
498
} ) ;
495
499
const mockHandleRes = createMockResponse ( ) ;
496
500
@@ -509,7 +513,9 @@ describe('SSEServerTransport', () => {
509
513
await transport . start ( ) ;
510
514
511
515
const mockReq = createMockRequest ( {
512
- 'content-type' : 'application/json' ,
516
+ headers : {
517
+ 'content-type' : 'application/json' ,
518
+ }
513
519
} ) ;
514
520
const mockHandleRes = createMockResponse ( ) ;
515
521
@@ -530,8 +536,10 @@ describe('SSEServerTransport', () => {
530
536
await transport . start ( ) ;
531
537
532
538
const mockReq = createMockRequest ( {
533
- origin : 'http://localhost:3000' ,
534
- 'content-type' : 'application/json' ,
539
+ headers : {
540
+ origin : 'http://localhost:3000' ,
541
+ 'content-type' : 'application/json' ,
542
+ }
535
543
} ) ;
536
544
const mockHandleRes = createMockResponse ( ) ;
537
545
@@ -550,8 +558,10 @@ describe('SSEServerTransport', () => {
550
558
await transport . start ( ) ;
551
559
552
560
const mockReq = createMockRequest ( {
553
- origin : 'http://evil.com' ,
554
- 'content-type' : 'application/json' ,
561
+ headers : {
562
+ origin : 'http://evil.com' ,
563
+ 'content-type' : 'application/json' ,
564
+ }
555
565
} ) ;
556
566
const mockHandleRes = createMockResponse ( ) ;
557
567
@@ -569,7 +579,9 @@ describe('SSEServerTransport', () => {
569
579
await transport . start ( ) ;
570
580
571
581
const mockReq = createMockRequest ( {
572
- 'content-type' : 'application/json' ,
582
+ headers : {
583
+ 'content-type' : 'application/json' ,
584
+ }
573
585
} ) ;
574
586
const mockHandleRes = createMockResponse ( ) ;
575
587
@@ -585,7 +597,9 @@ describe('SSEServerTransport', () => {
585
597
await transport . start ( ) ;
586
598
587
599
const mockReq = createMockRequest ( {
588
- 'content-type' : 'application/json; charset=utf-8' ,
600
+ headers : {
601
+ 'content-type' : 'application/json; charset=utf-8' ,
602
+ }
589
603
} ) ;
590
604
const mockHandleRes = createMockResponse ( ) ;
591
605
@@ -601,7 +615,9 @@ describe('SSEServerTransport', () => {
601
615
await transport . start ( ) ;
602
616
603
617
const mockReq = createMockRequest ( {
604
- 'content-type' : 'text/plain' ,
618
+ headers : {
619
+ 'content-type' : 'text/plain' ,
620
+ }
605
621
} ) ;
606
622
const mockHandleRes = createMockResponse ( ) ;
607
623
@@ -623,9 +639,11 @@ describe('SSEServerTransport', () => {
623
639
await transport . start ( ) ;
624
640
625
641
const mockReq = createMockRequest ( {
626
- host : 'evil.com' ,
627
- origin : 'http://evil.com' ,
628
- 'content-type' : 'text/plain' ,
642
+ headers : {
643
+ host : 'evil.com' ,
644
+ origin : 'http://evil.com' ,
645
+ 'content-type' : 'text/plain' ,
646
+ }
629
647
} ) ;
630
648
const mockHandleRes = createMockResponse ( ) ;
631
649
@@ -650,9 +668,11 @@ describe('SSEServerTransport', () => {
650
668
651
669
// Valid host, invalid origin
652
670
const mockReq1 = createMockRequest ( {
653
- host : 'localhost:3000' ,
654
- origin : 'http://evil.com' ,
655
- 'content-type' : 'application/json' ,
671
+ headers : {
672
+ host : 'localhost:3000' ,
673
+ origin : 'http://evil.com' ,
674
+ 'content-type' : 'application/json' ,
675
+ }
656
676
} ) ;
657
677
const mockHandleRes1 = createMockResponse ( ) ;
658
678
@@ -663,9 +683,11 @@ describe('SSEServerTransport', () => {
663
683
664
684
// Invalid host, valid origin
665
685
const mockReq2 = createMockRequest ( {
666
- host : 'evil.com' ,
667
- origin : 'http://localhost:3000' ,
668
- 'content-type' : 'application/json' ,
686
+ headers : {
687
+ host : 'evil.com' ,
688
+ origin : 'http://localhost:3000' ,
689
+ 'content-type' : 'application/json' ,
690
+ }
669
691
} ) ;
670
692
const mockHandleRes2 = createMockResponse ( ) ;
671
693
@@ -676,9 +698,11 @@ describe('SSEServerTransport', () => {
676
698
677
699
// Both valid
678
700
const mockReq3 = createMockRequest ( {
679
- host : 'localhost:3000' ,
680
- origin : 'http://localhost:3000' ,
681
- 'content-type' : 'application/json' ,
701
+ headers : {
702
+ host : 'localhost:3000' ,
703
+ origin : 'http://localhost:3000' ,
704
+ 'content-type' : 'application/json' ,
705
+ }
682
706
} ) ;
683
707
const mockHandleRes3 = createMockResponse ( ) ;
684
708
0 commit comments