Skip to content

feat: add support for WHATWG URLs#2437

Merged
gr2m merged 6 commits intonock:mainfrom
DesignByOnyx:designbyonyx/2435-whatwg-url-support
Jan 10, 2023
Merged

feat: add support for WHATWG URLs#2437
gr2m merged 6 commits intonock:mainfrom
DesignByOnyx:designbyonyx/2435-whatwg-url-support

Conversation

@DesignByOnyx
Copy link
Copy Markdown
Contributor

This closes #2435

I could not find a beta or next branch, so my changes were made against main. Please advise if I am missing something.

@mastermatt
Copy link
Copy Markdown
Member

I'm in favor of this.
@DesignByOnyx the tests are failing because lack of coverage for the Unrecognized URL error path.

I think I would also prefer if the invalid protocol TypeError was thrown from inside of normalizeUrl instead of the Scope constructor.

@DesignByOnyx DesignByOnyx force-pushed the designbyonyx/2435-whatwg-url-support branch from 7951fcf to 0e890da Compare January 5, 2023 18:50
@DesignByOnyx
Copy link
Copy Markdown
Contributor Author

DesignByOnyx commented Jan 5, 2023

@mastermatt - I have made the updates you requested. Thanks for the quick review.

A quick note on the change I made:

I got rid of the Unrecognized URL error. Instead, users can pass a legacy url object (url.parse(...)) or anything that the URL constructor supports (strings and URL instances as of this writing). If a user passes an invalid URL, I am letting the URL parser report the error.

@DesignByOnyx
Copy link
Copy Markdown
Contributor Author

Apologies, I had some trailing whitespace in there. I thought I had run the formatter. Should be good to go.

@mastermatt mastermatt requested a review from gr2m January 10, 2023 01:40
Copy link
Copy Markdown
Member

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

Nice

@gr2m gr2m merged commit 3375382 into nock:main Jan 10, 2023
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 13.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow WHATWG URL objects in interceptors

3 participants