-
Notifications
You must be signed in to change notification settings - Fork 96
Fix a TypeError of url.parse #640
Fix a TypeError of url.parse #640
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
10401e3
to
41c043f
Compare
@@ -178,7 +178,10 @@ export class Http2Plugin extends HttpPlugin { | |||
const userAgent = | |||
headers['user-agent'] || headers['User-Agent'] || null; | |||
|
|||
const host = url.parse(authority).host; | |||
const host = (authority instanceof url.URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @StoneDot for the fix! Would you be willing to add a unit test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, also update the CHANGELOG.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've written the tests for this PR, but it hasn't worked correctly because of another bug (See #641).
Could I tweak the tests to pass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I've updated CHANGELOG.md at #de29571
Currently I'm preparing to contract CLA as a company (Because this contribution was created on work time). It will take more time to sign a CLA. I am sorry for being late. |
7f18437
to
7c1134b
Compare
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Rebased to include #650 |
Could you wait merge? (It seems Googlebot doesn't work correctly for me.) |
@StoneDot Let us know if you are waiting for the next release ( |
@mayurkale22 Thanks! But I'm not in a rush. |
This PR fixes TypeError occurring when
http2.connect
is called withurl.URL
.It is permitted according to official document.
A following code reproduces the error.
Source:
Result: