@@ -469,8 +469,10 @@ describe('SSEServerTransport', () => {
469469 await transport . start ( ) ;
470470
471471 const mockReq = createMockRequest ( {
472- host : 'localhost:3000' ,
473- 'content-type' : 'application/json' ,
472+ headers : {
473+ host : 'localhost:3000' ,
474+ 'content-type' : 'application/json' ,
475+ }
474476 } ) ;
475477 const mockHandleRes = createMockResponse ( ) ;
476478
@@ -489,8 +491,10 @@ describe('SSEServerTransport', () => {
489491 await transport . start ( ) ;
490492
491493 const mockReq = createMockRequest ( {
492- host : 'evil.com' ,
493- 'content-type' : 'application/json' ,
494+ headers : {
495+ host : 'evil.com' ,
496+ 'content-type' : 'application/json' ,
497+ }
494498 } ) ;
495499 const mockHandleRes = createMockResponse ( ) ;
496500
@@ -509,7 +513,9 @@ describe('SSEServerTransport', () => {
509513 await transport . start ( ) ;
510514
511515 const mockReq = createMockRequest ( {
512- 'content-type' : 'application/json' ,
516+ headers : {
517+ 'content-type' : 'application/json' ,
518+ }
513519 } ) ;
514520 const mockHandleRes = createMockResponse ( ) ;
515521
@@ -530,8 +536,10 @@ describe('SSEServerTransport', () => {
530536 await transport . start ( ) ;
531537
532538 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+ }
535543 } ) ;
536544 const mockHandleRes = createMockResponse ( ) ;
537545
@@ -550,8 +558,10 @@ describe('SSEServerTransport', () => {
550558 await transport . start ( ) ;
551559
552560 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+ }
555565 } ) ;
556566 const mockHandleRes = createMockResponse ( ) ;
557567
@@ -569,7 +579,9 @@ describe('SSEServerTransport', () => {
569579 await transport . start ( ) ;
570580
571581 const mockReq = createMockRequest ( {
572- 'content-type' : 'application/json' ,
582+ headers : {
583+ 'content-type' : 'application/json' ,
584+ }
573585 } ) ;
574586 const mockHandleRes = createMockResponse ( ) ;
575587
@@ -585,7 +597,9 @@ describe('SSEServerTransport', () => {
585597 await transport . start ( ) ;
586598
587599 const mockReq = createMockRequest ( {
588- 'content-type' : 'application/json; charset=utf-8' ,
600+ headers : {
601+ 'content-type' : 'application/json; charset=utf-8' ,
602+ }
589603 } ) ;
590604 const mockHandleRes = createMockResponse ( ) ;
591605
@@ -601,7 +615,9 @@ describe('SSEServerTransport', () => {
601615 await transport . start ( ) ;
602616
603617 const mockReq = createMockRequest ( {
604- 'content-type' : 'text/plain' ,
618+ headers : {
619+ 'content-type' : 'text/plain' ,
620+ }
605621 } ) ;
606622 const mockHandleRes = createMockResponse ( ) ;
607623
@@ -623,9 +639,11 @@ describe('SSEServerTransport', () => {
623639 await transport . start ( ) ;
624640
625641 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+ }
629647 } ) ;
630648 const mockHandleRes = createMockResponse ( ) ;
631649
@@ -650,9 +668,11 @@ describe('SSEServerTransport', () => {
650668
651669 // Valid host, invalid origin
652670 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+ }
656676 } ) ;
657677 const mockHandleRes1 = createMockResponse ( ) ;
658678
@@ -663,9 +683,11 @@ describe('SSEServerTransport', () => {
663683
664684 // Invalid host, valid origin
665685 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+ }
669691 } ) ;
670692 const mockHandleRes2 = createMockResponse ( ) ;
671693
@@ -676,9 +698,11 @@ describe('SSEServerTransport', () => {
676698
677699 // Both valid
678700 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+ }
682706 } ) ;
683707 const mockHandleRes3 = createMockResponse ( ) ;
684708
0 commit comments