Implement RFC 7231 compliant relative URI and fragment handling in redirects (#13050)

This PR restores #13041 and integrates two PRs from @zanieb:
* #13038
* #13040

It also adds tests for relative URI and fragment handling.

Closes #13037.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
John Mumm 2025-04-28 09:07:06 +02:00 committed by GitHub
parent 576a4ae3a7
commit 4ee4a8861e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 696 additions and 37 deletions

View file

@ -52,7 +52,7 @@ impl GitResolver {
pub async fn github_fast_path(
&self,
url: &GitUrl,
client: ClientWithMiddleware,
client: &ClientWithMiddleware,
) -> Result<Option<GitOid>, GitResolverError> {
let reference = RepositoryReference::from(url);
@ -112,7 +112,7 @@ impl GitResolver {
pub async fn fetch(
&self,
url: &GitUrl,
client: ClientWithMiddleware,
client: impl Into<ClientWithMiddleware>,
disable_ssl: bool,
offline: bool,
cache: PathBuf,