3

I'm trying to get xdg-open to properly handle URIs with the pattern of ob://@username but it seems that xdg-open is stripping the @ symbol. Is there someway to prevent this without modifying xdg-open itself?

My openbazaar.desktop file consists of the following:

[Desktop Entry]
Name=OpenBazaar Client
Exec=openbazaar "%u"
Terminal=false
Type=Application
MimeType=x-scheme-handler/ob

If I put a character before the @ (i.e. ob://a@username) it doesn't remove it. I've verified that it's not an issue with running openbazaar ob://@username so I'm wondering if there's something I can do in the .desktop file to prevent it from doing this.

6

xdg-open is attempting to comply with the standards...

An @ mark is a delimiter between user- and host-names, and without the user-name it is unexpected (and not standard). If you want to use it in a different way, you will have to encode it.

Further reading:

  • Good one! I was reading the RFC and finding the use of @ ambiguous, not a surprise they published a clarification. – grochmal Aug 20 '16 at 18:59
  • Thanks for the answer. It looks like I'll have to take an alternate route. I tried encoding @ to %40 but I get an error stating that it's a malformed URL. – overra Aug 21 '16 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.