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 broken URLs parsed from relative paths in registries #1413

Merged
merged 3 commits into from
Feb 16, 2024
Merged

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Feb 16, 2024

Closes #1388

Fixes incorrect handling of relative paths returned by indexes without an explicit <base>.

Url.join will drop the last segment in an url e.g. http://foo/bar -> http://foo/baz if there is not a trailing slash but what we want is http://foo/bar/baz. We don't add the trailing / in base_url_join_relative because flat indexes are http://foo/bar.html and we want bar.html to be replaced.

@zanieb zanieb changed the title Add SimpleHtml test case for AWS CodeArtifact Add test cases for AWS CodeArtifact simple API responses Feb 16, 2024
@zanieb zanieb changed the title Add test cases for AWS CodeArtifact simple API responses Fix broken URLs parsed from relative paths in registries Feb 16, 2024
@zanieb zanieb marked this pull request as ready for review February 16, 2024 04:24
Comment on lines -39 to 48
#[error("Failed to parse URL: `{original}`")]
pub struct JoinRelativeError {
original: String,
source: url::ParseError,
pub enum JoinRelativeError {
#[error("Failed to parse URL: `{original}`")]
ParseError {
original: String,
source: url::ParseError,
},
}
Copy link
Member Author

Choose a reason for hiding this comment

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

I changed this when I was handling another error kind in here. Think it makes sense to leave it for the future, I prefer enum error wrappers.

@zanieb zanieb merged commit 0bfce35 into main Feb 16, 2024
7 checks passed
@zanieb zanieb deleted the zb/relative-html branch February 16, 2024 04:37
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.

uv pip install/compile fails on AWS codeartifact repo
2 participants