FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: inline origin resolution, drop `original` dependency by rexxars · Pull Request #281 · EventSource/eventsource · GitHub

fix: inline origin resolution, drop original dependency - #281

Merged
rexxars merged 1 commit into
v1.xfrom
fix/inline-original
Jun 8, 2022
Merged

fix: inline origin resolution, drop original dependency#281
rexxars merged 1 commit into
v1.xfrom
fix/inline-original

Conversation

rexxars commented Jun 7, 2022

Copy link
Copy Markdown
Member

Apparently the original dependency depends on url-parse module which recently saw some security issues reported. We are no longer depending on this as of 2.0, but the 1.x range does. In order to minimize noise related to this vulnerability, this PR moves the few lines of logic we depended on from this module into the 1.x branch. This ensures we still support node 12 (and 10?).

If approved, I will update the changelog and release a new patch release on the 1.x range - but I am eager to call this the last fix I will be doing for the 1.x range - ideally I would like to move to node 14 as the lowest supported version, following node LTS.

DaleGardner left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

👍

joeybaker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I've got a bit of a nit suggestion, but seems good!

Comment thread lib/eventsource.js
*/
function getOrigin (url) {
if (typeof url === 'string') url = parse(url)
if (!url.protocol || !url.hostname) return 'null'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

IMO 'null' is a little confusing. It could be perceived as a bug? Maybe we should return 'invalid url'?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It is confusing, but it is also in accordance with RFC6464, so I think I will leave it like this.

Comment thread lib/eventsource.js
*
* @param {String|Object} url URL to transform to it's origin.
* @returns {String} The origin.
* @api private

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

should leave @link https://github.com/unshiftio/original/blob/507b362269c0ad4405d095aedc227c40aecaf68a/index.js as credit to orignal code.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL