Bug 503904

Summary: kde-open doesn't handle x-scheme handlers correctly on URLs that include '-'
Product: [Frameworks and Libraries] frameworks-kio Reporter: Luan Vitor Simião Oliveira <luanv.oliveira>
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: kdelibs-bugs-null, nate
Priority: NOR    
Version First Reported In: 6.13.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: discord desktop file with scheme handler support

Description Luan Vitor Simião Oliveira 2025-05-08 02:28:45 UTC
Created attachment 181051 [details]
discord desktop file with scheme handler support

SUMMARY
if an app registers and x-scheme-handler mime type on their desktop file, and the urls for that app only include '-' on the hostname section, the handler will be ignored and the default web browser will be used instead.
discord is an example of this behavior, although they don't support it by default on Linux

STEPS TO REPRODUCE
1. put the attached file in $XDG_DATA_HOME/applications (might have to edit the exec to point to your discord install location)
2. make sure xdg-mime query default x-scheme-handler/discord returns discord.desktop
3. run kde-open "discord://-/settings/account"

OBSERVED RESULT
the url will be opened on the default web browser

EXPECTED RESULT
the discord app is opened on the settings page

SOFTWARE/OS VERSIONS

Operating System: Fedora Linux 42
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.13.0
Qt Version: 6.9.0
Kernel Version: 6.14.5-300.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 9800X3D 8-Core Processor
Memory: 30.5 GiB of RAM
Graphics Processor 1: NVIDIA GeForce RTX 4070 Ti SUPER
Graphics Processor 2: AMD Radeon Graphics
Manufacturer: ASUS

ADDITIONAL INFORMATION
gio open "discord://-/settings/account"
is able to correctly invoke discord on the settings page for me