Skip to content

Fix deep link installation for mods containing + (plus sign)#6464

Open
mfishma wants to merge 3 commits into
modrinth:mainfrom
mfishma:main
Open

Fix deep link installation for mods containing + (plus sign)#6464
mfishma wants to merge 3 commits into
modrinth:mainfrom
mfishma:main

Conversation

@mfishma

@mfishma mfishma commented Jun 22, 2026

Copy link
Copy Markdown

Fixes #6295

Summary

I was having issues where deeplinks to projects that have + in the name (like modrinth://mod/vb+) were breaking the app. It was a problem because that's the best way to have an app load an Unlisted project. The other option being the ID, but that wasn't safe to have people trust this random string of characters.

As is usually the case with "+", there was a problem with URL-encoding. The app wasn't encoding the + sign before asking the API for the mod data. So then the backend thinks the + is a space (it searches for "vb " instead of "vb+".) Since the mod with a space at the end doesn't exist, it returned nothing, and the app threw a cryptic project_type-is-null error.

Changes

  1. cache.rs Updated the URL builder to use url::form_urlencoded::byte_serialize(). This encodes the project ID (per RFC 3986) so the + actually makes it to the server correctly.
  2. content-install.ts I added a quick safety check. If a project fails to load (like if the link is a typo or missing), it now just shows a normal "Project not found" error instead of breaking the UI. And I put quotes around the ID in the error message so it's easier to spot accidental trailing spaces later.

Hope this helps! Let me know if you need me to change anything.

@modrinth-bot

Copy link
Copy Markdown
Member

Pull request changelog

App

Added

Changed

Deprecated

Removed

Fixed

Security

Website

Added

Changed

Deprecated

Removed

Fixed

Security

Hosting

Added

Changed

Deprecated

Removed

Fixed

Security

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Null error when opening mod ending with "+" in Windows app

2 participants