Skip to content

Commit 5302e3a

Browse files
authored
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
1 parent 9b4c84d commit 5302e3a

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

apps/app-frontend/src/providers/content-install.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,11 @@ export function createContentInstall(opts: {
807807
) {
808808
const project: Labrinth.Projects.v2.Project = await get_project(projectId, 'must_revalidate')
809809

810+
if (!project) {
811+
opts.handleError(`Project not found: '${projectId}'`)
812+
return
813+
}
814+
810815
if (project.project_type === 'modpack') {
811816
const version = versionId ?? project.versions[project.versions.length - 1]
812817
const packs = await list()

packages/app-lib/src/state/cache.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,8 +1105,15 @@ impl CachedEntry {
11051105
.collect::<Vec<_>>()
11061106
.chunks(MAX_REQUEST_SIZE)
11071107
.map(|chunk| {
1108-
serde_json::to_string(&chunk)
1109-
.map(|keys| format!("{api_url}{url}{keys}"))
1108+
serde_json::to_string(&chunk).map(|keys| {
1109+
format!(
1110+
"{api_url}{url}{}",
1111+
url::form_urlencoded::byte_serialize(
1112+
keys.as_bytes()
1113+
)
1114+
.collect::<String>()
1115+
)
1116+
})
11101117
})
11111118
.collect::<Result<Vec<_>, _>>()?;
11121119

0 commit comments

Comments
 (0)