fix: import url from node to support domainToASCII#163
Open
SebouChu wants to merge 1 commit intofastify:mainfrom
Open
fix: import url from node to support domainToASCII#163SebouChu wants to merge 1 commit intofastify:mainfrom
SebouChu wants to merge 1 commit intofastify:mainfrom
Conversation
Member
|
CI is failing |
Author
|
Oh, didn't think about the browser usage. Which let me thinking about why fast-uri uses a method that does not exist in browser environment? |
Author
|
@mcollina What do you think about the idea of not converting the host to an ASCII representation, and keeps it in Unicode form? The method currently does not work at all, and to stay in the "dependency-free" state, I think it's better to leave the host as it is. |
Member
|
Do you think you could provide a fallback for domainToASCII for browsers? |
Author
|
In NodeJS, it's implemented in C code, so I don't really know how to implement natively here. If you're more familiar with it: https://github.com/nodejs/node/blob/main/src/node_url.cc#L184 |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No test was covering the usage of URL.domainToASCII which is failing in the current state.
The added test returns this without the fix:
So we import the url module from Node to support the function.
Open to any suggestions if needed, thanks!
Checklist
npm run test && npm run benchmark --if-presentand the Code of conduct