Skip to content

Fix parsing of unquoted URLs#409

Merged
jpsim merged 1 commit into
jpsim:mainfrom
czechboy0:hd-fix-unquoted-url-parsing
Mar 15, 2024
Merged

Fix parsing of unquoted URLs#409
jpsim merged 1 commit into
jpsim:mainfrom
czechboy0:hd-fix-unquoted-url-parsing

Conversation

@czechboy0

Copy link
Copy Markdown
Contributor

Summary

I believe this fixes #337, which I also just hit.

The problem is that trying to parse an int succeeded for the unquoted string http://example.com (parsed as the number 0), which caused issues when using an "AnyCodable" approach.

This PR makes the parsing stricter, so that a URL like above does not successfully parse as an int, and allows "AnyCodable" wrappers to only successfully parse the value as a string.

Test Plan

Added a unit test both for the positive and negative cases.

@jpsim jpsim left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks great, thank you so much for the fix!

@jpsim jpsim merged commit 626b33b into jpsim:main Mar 15, 2024
@czechboy0 czechboy0 deleted the hd-fix-unquoted-url-parsing branch March 15, 2024 16:17
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.

Issue with sexagesimal support

2 participants