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

fix: fragment encoding #23

Merged
merged 4 commits into from
Feb 5, 2022
Merged

fix: fragment encoding #23

merged 4 commits into from
Feb 5, 2022

Conversation

zekth
Copy link
Member

@zekth zekth commented Feb 4, 2022

[Draft]
currently having issue with fragment encoding like:

  • #/$defs/stringMap
  • #/$defs/string%20Map

Checklist

}
if (parsed.fragment !== undefined && parsed.fragment.length) {
parsed.fragment = escape(parsed.fragment)
parsed.fragment = encodeURI(decodeURI(parsed.fragment))
Copy link
Member

Choose a reason for hiding this comment

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

I miss the escape usage.
There is any reason to prefer it over encodeURI and decodeURI?

This fix could impact the performance.. need to try it

Copy link
Member Author

Choose a reason for hiding this comment

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

Iirc i switched to escape because it was faster. I'll have to run some benchmarks. But at the moment i switched i cleaned up a lot the parse flow. Going to check

@coveralls

This comment was marked as spam.

@coveralls

This comment was marked as off-topic.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@zekth zekth marked this pull request as ready for review February 5, 2022 11:30
@zekth
Copy link
Member Author

zekth commented Feb 5, 2022

@mcollina @Eomm using encode/decode is not impacting that much, still a bit but not crazy high overhead. I'd land this as a patch and we can take care of the whole encoding flow issue in another PR.
Sorry when i refactored it i might have missed some spots and got lost at some point.

@zekth zekth merged commit fc3eb31 into main Feb 5, 2022
@zekth zekth deleted the fix-encoding-parse branch February 5, 2022 12:30
@zekth zekth mentioned this pull request Feb 5, 2022
2 tasks
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.

None yet

4 participants