| Summary: | kde-open with long custom URI opens browser instead of correct application | ||
|---|---|---|---|
| Product: | [Plasma] kde-cli-tools | Reporter: | egerlach <kde> |
| Component: | general | Assignee: | Aleix Pol <aleixpol> |
| Status: | RESOLVED INTENTIONAL | ||
| Severity: | normal | CC: | fanzhuyifan |
| Priority: | NOR | ||
| Version First Reported In: | 5.27.9 | ||
| Target Milestone: | --- | ||
| Platform: | Debian stable | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
egerlach
2023-07-01 23:23:32 UTC
I just tried on KDE Neon and got the same result: Operating System: KDE neon Testing Edition KDE Plasma Version: 5.27.6 KDE Frameworks Version: 5.108.0 Qt Version: 5.15.10 Kernel Version: 5.19.0-45-generic (64-bit) Graphics Platform: X11 Can reproduce. For me the cutoff is between `slack://123k1j2lk3j1lk23jasdfsadkfklsadjflksjakfjsdafsakjfksjfklsdjalfg1` and `slack://123k1j2lk3j1lk23jasdfsadkfklsadjflksjakfjsdafsakjfksjfklsdjalfg`. After some research, I am closing this as INTENTIONAL. Short answer: Don't add the double slashes for custom schemes. Just use custom-scheme:xxxxx, instead of custom-scheme://xxxxxx. Long answer: With the double slashes, the part that comes after will be interpreted as a host. As per specifications, the host cannot have more than 63 characters. So QUrl::fromUserInput perceives this to be an invalid url, and tries to fix this. The 'fixed' url becomes http://custom-scheme//xxxxxxx. On the other hand, if the double slashes are not included, then what comes after becomes interpreted as the path, which does not have the 63 character limit. So QUrl::fromUserInput treats it as valid url and doesn't modify it. References: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names https://bugreports.qt.io/browse/QTBUG-18280 |