File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -71,16 +71,16 @@ class EventSource {
71
71
this . _xhr . withCredentials = true ;
72
72
}
73
73
74
+ this . _xhr . setRequestHeader ( 'Accept' , 'text/event-stream' ) ;
75
+ this . _xhr . setRequestHeader ( 'Cache-Control' , 'no-cache' ) ;
76
+ this . _xhr . setRequestHeader ( 'X-Requested-With' , 'XMLHttpRequest' ) ;
77
+
74
78
if ( this . headers ) {
75
79
for ( const [ key , value ] of Object . entries ( this . headers ) ) {
76
80
this . _xhr . setRequestHeader ( key , value ) ;
77
81
}
78
82
}
79
83
80
- this . _xhr . setRequestHeader ( 'Accept' , 'text/event-stream' ) ;
81
- this . _xhr . setRequestHeader ( 'Cache-Control' , 'no-cache' ) ;
82
- this . _xhr . setRequestHeader ( 'X-Requested-With' , 'XMLHttpRequest' ) ;
83
-
84
84
if ( this . lastEventId !== null ) {
85
85
this . _xhr . setRequestHeader ( 'Last-Event-ID' , this . lastEventId ) ;
86
86
}
You can’t perform that action at this time.
0 commit comments