mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 00:55:25 +00:00
Fix deep link installation for mods containing + (plus sign) (#6464)
* ffix: preserve literal '+' in deep link URI thru API call * chore: check for missing projects during installs * chore: remove accidental test files and quote error ID * fix rustfmt formatting for the change
This commit is contained in:
@@ -807,6 +807,11 @@ export function createContentInstall(opts: {
|
|||||||
) {
|
) {
|
||||||
const project: Labrinth.Projects.v2.Project = await get_project(projectId, 'must_revalidate')
|
const project: Labrinth.Projects.v2.Project = await get_project(projectId, 'must_revalidate')
|
||||||
|
|
||||||
|
if (!project) {
|
||||||
|
opts.handleError(`Project not found: '${projectId}'`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (project.project_type === 'modpack') {
|
if (project.project_type === 'modpack') {
|
||||||
const version = versionId ?? project.versions[project.versions.length - 1]
|
const version = versionId ?? project.versions[project.versions.length - 1]
|
||||||
const packs = await list()
|
const packs = await list()
|
||||||
|
|||||||
@@ -1105,8 +1105,15 @@ impl CachedEntry {
|
|||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.chunks(MAX_REQUEST_SIZE)
|
.chunks(MAX_REQUEST_SIZE)
|
||||||
.map(|chunk| {
|
.map(|chunk| {
|
||||||
serde_json::to_string(&chunk)
|
serde_json::to_string(&chunk).map(|keys| {
|
||||||
.map(|keys| format!("{api_url}{url}{keys}"))
|
format!(
|
||||||
|
"{api_url}{url}{}",
|
||||||
|
url::form_urlencoded::byte_serialize(
|
||||||
|
keys.as_bytes()
|
||||||
|
)
|
||||||
|
.collect::<String>()
|
||||||
|
)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.collect::<Result<Vec<_>, _>>()?;
|
.collect::<Result<Vec<_>, _>>()?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user