Bug 498019 - URL Passed to Schema Handler is Altered
Summary: URL Passed to Schema Handler is Altered
Status: RESOLVED UPSTREAM
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 6.9.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-29 15:07 UTC by Michael Kreitzer
Modified: 2025-02-15 10:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Kreitzer 2024-12-29 15:07:16 UTC
There appears to be some kind of attempt at normalizing or rebuilding a protocol handler URL causing the URL to be altered before it is passed to the handler. The specific case I encountered this is with the game Vintage Story. It allows installing mods through such a handler. An example URL it would pass is:

vintagestorymodinstall://vsimgui@1.1.7

Running kioclient exec 'vintagestorymodinstall://vsimgui@1.1.7' results in the following URL being passed to the application:

vintagestorymodinstall://vsimgui@1.1.0.7

This looks to me like it's trying to parse the URL and treating it as a username and an IP address. My understanding is that it is the role of the handler to interpret the contents of the URL and it should be passed unchanged. In this case these components represent a mod name and a version number.

I tried to track this down but got lost somewhere in between openurljob.cpp and applicationlauncherjob.cpp.
Comment 1 Nate Graham 2025-01-04 04:39:17 UTC
Very strange. I can reproduce it.
Comment 2 Harald Sitter 2025-01-07 22:44:10 UTC
This actually happens right when the QUrl gets created.

https://invent.kde.org/qt/qt/qtbase/-/blob/1da7558bfd7626bcc40a214a90ae5027f32f6c7f/src/corelib/io/qurl.cpp?page=2#L1141

Intentional behavior in Qt. Though arguably we should be able to opt out of this. At the same time one has to wonder if we want to because posix conforming command line tools all behave like this and we do run mutations on the input anyway because we also accept local file paths and what not.

❯ ping 1.1.0
PING 1.1.0 (1.1.0.0) 56(84) bytes of data.

In any event, best file an upstream bug about this.
Comment 3 Michael Kreitzer 2025-02-15 10:20:51 UTC
I've reported this to the Vintage Story devs as I don't think Qt is doing anything wrong here. For anyone wishing to follow this, the report is here: https://github.com/anegostudios/VintageStory-Issues/issues/5312