Socket
Socket
Sign inDemoInstall

eventsource

Package Overview
Dependencies
0
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.1 to 1.1.2

4

HISTORY.md

@@ -0,1 +1,5 @@

# [1.1.2](https://github.com/EventSource/eventsource/compare/v1.1.1...v1.1.2)
* Inline origin resolution, drops `original` dependency ([#281](https://github.com/EventSource/eventsource/pull/281) Espen Hovlandsdal)
# [1.1.1](https://github.com/EventSource/eventsource/compare/v1.1.0...v1.1.1)

@@ -2,0 +6,0 @@

20

lib/eventsource.js

@@ -1,2 +0,1 @@

var original = require('original')
var parse = require('url').parse

@@ -160,4 +159,4 @@ var events = require('events')

}
var prevOrigin = original(url)
var nextOrigin = original(location)
var prevOrigin = getOrigin(url)
var nextOrigin = getOrigin(location)
hasNewOrigin = prevOrigin !== nextOrigin

@@ -284,3 +283,3 @@ if (res.statusCode === 307) reconnectUrl = url

lastEventId: lastEventId,
origin: original(url)
origin: getOrigin(url)
}))

@@ -476,1 +475,14 @@ data = ''

}
/**
* Transform an URL to a valid origin value.
*
* @param {String|Object} url URL to transform to it's origin.
* @returns {String} The origin.
* @api private
*/
function getOrigin (url) {
if (typeof url === 'string') url = parse(url)
if (!url.protocol || !url.hostname) return 'null'
return (url.protocol + '//' + url.host).toLowerCase()
}
{
"name": "eventsource",
"version": "1.1.1",
"version": "1.1.2",
"description": "W3C compliant EventSource client for Node.js and browser (polyfill)",

@@ -51,5 +51,2 @@ "keywords": [

},
"dependencies": {
"original": "^1.0.0"
},
"standard": {

@@ -56,0 +53,0 @@ "ignore": [

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc