← Back to team overview

desktop-packages team mailing list archive

[Bug 1526566] Re: Wrong URL opens in browser when generating oauth token

 

Reported here: https://bugs.freedesktop.org/show_bug.cgi?id=93444

** Bug watch added: freedesktop.org Bugzilla #93444
   https://bugs.freedesktop.org/show_bug.cgi?id=93444

** Also affects: xdg-utils (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: xdg-utils (Ubuntu)
       Status: New => Confirmed

** Also affects: xdg-utils via
   https://bugs.freedesktop.org/show_bug.cgi?id=93444
   Importance: Unknown
       Status: Unknown

** Summary changed:

- Wrong URL opens in browser when generating oauth token
+ xdg-open truncates URLs at the first '&'

** Description changed:

- Ok guys this one is real strange. Consider the following script:
+ $ xdg-open 'http://example.com/?foo&bar'
  
- http://bazaar.launchpad.net/+branch/cupstream2distro/view/head:/token_generator.py
+ Expected behavior: that URL opens in my browser
  
- (essentially trivial call to Launchpad.login_with() and explicitly using
- python2 due to bug 1526563).
- 
- When I run it, I get this output:
- 
- $ ./token_generator.py 
- The authorization page:
-  (https://launchpad.net/+authorize-token?oauth_token=H17khGCRnvSzc10PzjZl&allow_permission=DESKTOP_INTEGRATION)
- should be opening in your browser. Use your browser to authorize
- this program to access Launchpad on your behalf.
- Waiting to hear from Launchpad about your decision...
- 
- However the page that loads in my browser is just the truncated URL
- https://launchpad.net/+authorize-token?oauth_token=H17khGCRnvSzc10PzjZl
- which displays a 403.
- 
- If I then hover my mouse over that link in the terminal, the URL is
- correctly underlined (eg, including the
- allow_permission=DESKTOP_INTEGRATION and not including the parentheses,
- however if I right click (in gnome terminal) and choose "open link",
- STILL the wrong URL opens (same wrong URL, truncated at the &).
- 
- In order to make this work, I have to copy&paste the full URL, and then
- only when manually pasting the URL into the browser window does the page
- load correctly and allow me to authorize the token.
- 
- So quite strange behavior here, URL is being truncated, but I'm not sure
- by what or why. I guess firefox is doing it? It doesn't make sense that
- lplib script and gnome-terminal when clicking the link would both
- truncate in the same way (especially since gnome terminal underlines the
- correct url).
- 
- This is on xenial, with latest updates installed, using firefox as
- default browser.
+ Actual behavior: browser opens 'http://example.com/?foo'

** Changed in: xdg-utils (Ubuntu)
    Milestone: None => ubuntu-16.04

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to xdg-utils in Ubuntu.
https://bugs.launchpad.net/bugs/1526566

Title:
  xdg-open truncates URLs at the first '&'

Status in launchpadlib :
  Invalid
Status in Xdg-utils:
  Unknown
Status in xdg-utils package in Ubuntu:
  Confirmed

Bug description:
  $ xdg-open 'http://example.com/?foo&bar'

  Expected behavior: that URL opens in my browser

  Actual behavior: browser opens 'http://example.com/?foo'

To manage notifications about this bug go to:
https://bugs.launchpad.net/launchpadlib/+bug/1526566/+subscriptions