Cargo package - Fix missing domain in cargo sparse url (#27370)

Hello, it seems that one my previous PR (adding the sparse index to the
cargo package content page), did not worked as expected: the
gitea-origin-url does not add the AppURL because of the `sparse+` prefix
in the url.
Currently the rendered page gives the following:
```toml
[registry]
default = "gitea"

[registries.gitea]
index = "sparse+/api/packages/ownername/cargo/" # Sparse index
# index = "https://git.example.com/ownername/_cargo-index.git" # Git

[net]
git-fetch-with-cli = true
```

(cherry picked from commit a112cf34d3)
(cherry picked from commit 4e30c94a40c5c959a2d83498c24095556bfd9e80)
(cherry picked from commit 72a1d0403f28146a057aada3be1a6ebfce262db0)
(cherry picked from commit 9c3d42f69754d36741b58a581cfa10647aa67f72)
(cherry picked from commit b66322a5e388ed3e5e2a0d88830a2d4725fec7c8)
(cherry picked from commit 25019a6d283d395adc51c6929edc6b27853452f3)
(cherry picked from commit 124b4dc6e4ed82eccf466877e13c73fc87d00061)
This commit is contained in:
merlleu 2023-10-01 15:43:15 +02:00 committed by Earl Warren
parent cd38789ab2
commit 82a767dc76
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -8,7 +8,7 @@
default = "gitea"
[registries.gitea]
index = "<gitea-origin-url data-url="sparse+{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/cargo/"></gitea-origin-url>" # Sparse index
index = "sparse+<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/cargo/"></gitea-origin-url>" # Sparse index
# index = "<gitea-origin-url data-url="{{AppSubUrl}}/{{.PackageDescriptor.Owner.Name}}/_cargo-index.git"></gitea-origin-url>" # Git
[net]