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

ensure that % is escaped during percent encoding #15

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

jcreekmore
Copy link
Contributor

Since the % sign is used for the escape in percent encoding, we need to ensure that that is itself escaped if found in the input. Debian git tags in vcs_urls in particular seem to be moving to replacing the : in a version like 1:41.1 into 1%41.1. The correct encoding of that winds up being 1%2541.1. Without this, adding the vcs_url as it is given will wind up forcing the parsing of the subsequent displayed PackageUrl to decode the 1%41.1 as 1A.1.

Fixes #12.

Since the % sign is used for the escape in percent encoding, we need to
ensure that that is itself escaped if found in the input. Debian git tags
in vcs_urls in particular seem to be moving to replacing the : in a
version like `1:41.1` into `1%41.1`. The correct encoding of that winds
up being `1%2541.1`. Without this, adding the vcs_url as it is given
will wind up forcing the _parsing_ of the subsequent displayed
PackageUrl to decode the `1%41.1` as `1A.1`.

Fixes althonos#12.
Copy link

codecov bot commented Aug 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@3dd4756). Learn more about missing BASE report.
Report is 45 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #15   +/-   ##
=========================================
  Coverage          ?   86.15%           
=========================================
  Files             ?        7           
  Lines             ?      260           
  Branches          ?        0           
=========================================
  Hits              ?      224           
  Misses            ?       36           
  Partials          ?        0           
Flag Coverage Δ
default 84.61% <ø> (?)
memchr 84.61% <ø> (?)
rust-beta 86.15% <ø> (?)
rust-nightly 86.15% <ø> (?)
rust-stable 86.15% <ø> (?)
serde 84.61% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ctron ctron merged commit 2dcc4ec into althonos:master Aug 30, 2024
13 checks passed
@ctron
Copy link
Collaborator

ctron commented Aug 30, 2024

Thanks for the PR. It's released as 0.4.1, which also has some compatibility for the 0.3.x version.

@jcreekmore
Copy link
Contributor Author

Thanks!

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.

Unable to round trip values containing %
2 participants