File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -717,7 +717,7 @@ describe("SSEClientTransport", () => {
717
717
eventSourceInit : {
718
718
fetch : ( url , init ) => {
719
719
return fetch ( url , { ...init , headers : {
720
- ...init ?. headers ,
720
+ ...( init ?. headers instanceof Headers ? Object . fromEntries ( init . headers . entries ( ) ) : init ?. headers ) ,
721
721
'X-Custom-Header' : 'custom-value'
722
722
} } ) ;
723
723
}
Original file line number Diff line number Diff line change @@ -130,9 +130,7 @@ export class SSEClientTransport implements Transport {
130
130
headers . set ( "Accept" , "text/event-stream" ) ;
131
131
const response = await fetchImpl ( url , {
132
132
...init ,
133
- headers : {
134
- ...Object . fromEntries ( headers . entries ( ) ) ,
135
- }
133
+ headers,
136
134
} )
137
135
138
136
if ( response . status === 401 && response . headers . has ( 'www-authenticate' ) ) {
You can’t perform that action at this time.
0 commit comments