eventsource
Advanced tools
+7
-5
| language: node_js | ||
| node_js: | ||
| - '0.12' | ||
| - '4' | ||
| - '6' | ||
| - '8' | ||
| - '10' | ||
| - "0.12" | ||
| - "4" | ||
| - "6" | ||
| - "8" | ||
| - "10" | ||
| - "12" | ||
| - "13" |
+9
-0
@@ -0,1 +1,10 @@ | ||
| # [1.1.0](https://github.com/EventSource/eventsource/compare/v1.0.7...v1.1.0) | ||
| * Improve performance for large messages across many chunks ([#130](https://github.com/EventSource/eventsource/pull/130) Trent Willis) | ||
| * Add `createConnection` option for http or https requests ([#120](https://github.com/EventSource/eventsource/pull/120) Vasily Lavrov) | ||
| * Support HTTP 302 redirects ([#116](https://github.com/EventSource/eventsource/pull/116) Ryan Bonte) | ||
| * Prevent sequential errors from attempting multiple reconnections ([#125](https://github.com/EventSource/eventsource/pull/125) David Patty) | ||
| * Add `new` to correct test ([#111](https://github.com/EventSource/eventsource/pull/101) Stéphane Alnet) | ||
| * Fix reconnections attempts now happen more than once ([#136](https://github.com/EventSource/eventsource/pull/136) Icy Fish) | ||
| # [1.0.7](https://github.com/EventSource/eventsource/compare/v1.0.6...v1.0.7) | ||
@@ -2,0 +11,0 @@ |
+19
-4
@@ -48,2 +48,3 @@ var original = require('original') | ||
| self.reconnectInterval = 1000 | ||
| self.connectionInProgress = false | ||
@@ -62,5 +63,6 @@ function onConnectionClosed (message) { | ||
| setTimeout(function () { | ||
| if (readyState !== EventSource.CONNECTING) { | ||
| if (readyState !== EventSource.CONNECTING || self.connectionInProgress) { | ||
| return | ||
| } | ||
| self.connectionInProgress = true | ||
| connect() | ||
@@ -101,2 +103,6 @@ }, self.reconnectInterval) | ||
| if (eventSourceInitDict && eventSourceInitDict.createConnection !== undefined) { | ||
| options.createConnection = eventSourceInitDict.createConnection | ||
| } | ||
| // If specify http proxy, make the request to sent to the proxy server, | ||
@@ -137,2 +143,3 @@ // and include the original url in path and Host headers | ||
| req = (isSecure ? https : http).request(options, function (res) { | ||
| self.connectionInProgress = false | ||
| // Handle HTTP errors | ||
@@ -146,3 +153,3 @@ if (res.statusCode === 500 || res.statusCode === 502 || res.statusCode === 503 || res.statusCode === 504) { | ||
| // Handle HTTP redirects | ||
| if (res.statusCode === 301 || res.statusCode === 307) { | ||
| if (res.statusCode === 301 || res.statusCode === 302 || res.statusCode === 307) { | ||
| if (!res.headers.location) { | ||
@@ -182,2 +189,4 @@ // Server sent redirect response without Location header. | ||
| var buf | ||
| var startingPos = 0 | ||
| var startingFieldLength = -1 | ||
| res.on('data', function (chunk) { | ||
@@ -202,6 +211,6 @@ buf = buf ? Buffer.concat([buf, chunk]) : chunk | ||
| var lineLength = -1 | ||
| var fieldLength = -1 | ||
| var fieldLength = startingFieldLength | ||
| var c | ||
| for (var i = pos; lineLength < 0 && i < length; ++i) { | ||
| for (var i = startingPos; lineLength < 0 && i < length; ++i) { | ||
| c = buf[i] | ||
@@ -221,3 +230,8 @@ if (c === colon) { | ||
| if (lineLength < 0) { | ||
| startingPos = length - pos | ||
| startingFieldLength = fieldLength | ||
| break | ||
| } else { | ||
| startingPos = 0 | ||
| startingFieldLength = -1 | ||
| } | ||
@@ -239,2 +253,3 @@ | ||
| req.on('error', function (err) { | ||
| self.connectionInProgress = false | ||
| onConnectionClosed(err.message) | ||
@@ -241,0 +256,0 @@ }) |
+1
-1
| { | ||
| "name": "eventsource", | ||
| "version": "1.0.7", | ||
| "version": "1.1.0", | ||
| "description": "W3C compliant EventSource client for Node.js and browser (polyfill)", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
9032
0.17%316499
-28.84%13
-7.14%62
1.64%