Skip to content

Commit

Permalink
Update eventsource.js
Browse files Browse the repository at this point in the history
Fixes this issue: EventSource#321
  • Loading branch information
rjurado01 committed Jun 20, 2023
1 parent 79dacfa commit b9eea2a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/eventsource.js
Expand Up @@ -90,6 +90,7 @@ function EventSource (url, eventSourceInitDict) {
var options = parse(url)
var isSecure = options.protocol === 'https:'
options.headers = { 'Cache-Control': 'no-cache', 'Accept': 'text/event-stream' }
options.method = 'GET'
if (lastEventId) options.headers['Last-Event-ID'] = lastEventId
if (headers) {
var reqHeaders = hasNewOrigin ? removeUnsafeHeaders(headers) : headers
Expand Down

0 comments on commit b9eea2a

Please sign in to comment.