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

agents: added check that metadata_url ends with / #765

Merged
merged 1 commit into from
Feb 6, 2023

Conversation

mjsterckx
Copy link
Contributor

Issue number:

Closes #762

Description of changes:

Added a check in tuf.rs:tuf_repo_urls to see if metadata_url ends with a forward slash. If it doesn't, append a forward slash. This will prevent Url::join from overwriting the URL segment after the last forward slash.

Testing done:

Two unit tests: one with metadata_url not ending with forward slash, the other with metadata_url ending with forward slash. Both result in the same complete URL after joining.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@mjsterckx mjsterckx requested review from webern and ecpullen February 6, 2023 19:23
@ecpullen ecpullen merged commit 091cc6f into bottlerocket-os:develop Feb 6, 2023
@mjsterckx mjsterckx deleted the metadata_url_fix branch February 6, 2023 20:52
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.

agents: metadata_url gets partially overwritten if it has no trailing "/"
3 participants