Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for WHATWG URLs #2437

merged 6 commits into from Jan 10, 2023


Copy link

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.

Copy link

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
Copy link
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.

Copy link
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

@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.


@gr2m gr2m merged commit 3375382 into nock:main Jan 10, 2023
16 checks passed
Copy link

🎉 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
None yet

Successfully merging this pull request may close these issues.

Allow WHATWG URL objects in interceptors
3 participants