Skip to content

Commit

Permalink
Merge pull request #249 from AlexHladin/remove-original-dependency
Browse files Browse the repository at this point in the history
Remove the original dependency and switch it to URL module
  • Loading branch information
joeybaker committed Mar 1, 2022
2 parents adc6e49 + 1b722b8 commit fa900cc
Show file tree
Hide file tree
Showing 3 changed files with 10,288 additions and 45 deletions.
4 changes: 2 additions & 2 deletions lib/eventsource.js
@@ -1,5 +1,5 @@
var original = require('original')
var parse = require('url').parse
var URL = require('url').URL
var events = require('events')
var https = require('https')
var http = require('http')
Expand Down Expand Up @@ -293,7 +293,7 @@ function EventSource (url, eventSourceInitDict) {
_emit(type, new MessageEvent(type, {
data: data.slice(0, -1), // remove trailing newline
lastEventId: lastEventId,
origin: original(url)
origin: new URL(url).origin
}))
data = ''
}
Expand Down

0 comments on commit fa900cc

Please sign in to comment.