[Ubuntu-webapps-bugs] [Bug 1358622] Re: webapp container redirection URL trimming breaks links to twitter in facebook app

2016-02-27 Thread Alexandre Abreu
** Changed in: webapps-core
   Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
WebApps bug tracking, which is subscribed to webbrowser-app.
https://bugs.launchpad.net/bugs/1358622

Title:
  webapp container redirection URL trimming breaks links to twitter in
  facebook app

Status in The Webapps-core project:
  Fix Released
Status in webbrowser-app:
  Fix Released
Status in webbrowser-app package in Ubuntu:
  Fix Released

Bug description:
  Consider a facebook post that contains a link to
  "http://t.co/OvsXJpPCtM; (twitter URL shortener). Facebook encodes
  this link as
  
"http://lm.facebook.com/l.php?u=http%3A%2F%2Ft.co%2FOvsXJpPCtM=rAQH6jL54=1;,
  which redirects to the original link.

  However calling Qt.openUrlExternally(…) on the encoded link won’t open
  it in the browser (or in the twitter webapp), it will trigger the URL
  dispatcher with the facebook webapp itself. So the actual link needs
  to be extracted from the encoded URL.

  The webapp container already has a mechanism to do that, in the form
  of a --popup-redirection-url-prefix command-line parameter, which
  basically trims the corresponding prefix off an encoded URL. For
  facebook, this prefix is "http://lm.facebook.com/l.php?u=;. So the
  encoded URL is transformed into
  "http%3A%2F%2Ft.co%2FOvsXJpPCtM=rAQH6jL54=1" and then decoded,
  which gives "http://t.co/OvsXJpPCtM=rAQH6jL54=1;, which ends up on
  a 404, because of the additional parameters "=rAQH6jL54=1" that
  were part of the encoded URL, not the original one.

  This prefix mechanism is too simple, we probably need a regexp
  mechanism to properly extract the target URL from the encoded form,
  without leaving trailing parameters.

  Note that in the current release of webapp-container as of today
  (0.23+14.10.20140818.2-0ubuntu1), there is a bug whereby the encoded
  URL is used, not the trimmed one. The following MR fixes this bug, but
  hits the 404 issue with twitter links in facebook posts:
  https://code.launchpad.net/~osomon/webbrowser-app/filter-session-
  storage-url-save/+merge/231204.

To manage notifications about this bug go to:
https://bugs.launchpad.net/webapps-core/+bug/1358622/+subscriptions

-- 
Mailing list: https://launchpad.net/~ubuntu-webapps-bugs
Post to : ubuntu-webapps-bugs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-webapps-bugs
More help   : https://help.launchpad.net/ListHelp


[Ubuntu-webapps-bugs] [Bug 1358622] Re: webapp container redirection URL trimming breaks links to twitter in facebook app

2014-11-07 Thread Alexandre Abreu
** Also affects: webapps-core
   Importance: Undecided
   Status: New

-- 
You received this bug notification because you are a member of Ubuntu
WebApps bug tracking, which is subscribed to webbrowser-app.
https://bugs.launchpad.net/bugs/1358622

Title:
  webapp container redirection URL trimming breaks links to twitter in
  facebook app

Status in The Webapps-core project:
  New
Status in Web Browser App:
  Fix Released
Status in “webbrowser-app” package in Ubuntu:
  Fix Released

Bug description:
  Consider a facebook post that contains a link to
  http://t.co/OvsXJpPCtM; (twitter URL shortener). Facebook encodes
  this link as
  
http://lm.facebook.com/l.php?u=http%3A%2F%2Ft.co%2FOvsXJpPCtMh=rAQH6jL54s=1;,
  which redirects to the original link.

  However calling Qt.openUrlExternally(…) on the encoded link won’t open
  it in the browser (or in the twitter webapp), it will trigger the URL
  dispatcher with the facebook webapp itself. So the actual link needs
  to be extracted from the encoded URL.

  The webapp container already has a mechanism to do that, in the form
  of a --popup-redirection-url-prefix command-line parameter, which
  basically trims the corresponding prefix off an encoded URL. For
  facebook, this prefix is http://lm.facebook.com/l.php?u=;. So the
  encoded URL is transformed into
  http%3A%2F%2Ft.co%2FOvsXJpPCtMh=rAQH6jL54s=1 and then decoded,
  which gives http://t.co/OvsXJpPCtMh=rAQH6jL54s=1;, which ends up on
  a 404, because of the additional parameters h=rAQH6jL54s=1 that
  were part of the encoded URL, not the original one.

  This prefix mechanism is too simple, we probably need a regexp
  mechanism to properly extract the target URL from the encoded form,
  without leaving trailing parameters.

  Note that in the current release of webapp-container as of today
  (0.23+14.10.20140818.2-0ubuntu1), there is a bug whereby the encoded
  URL is used, not the trimmed one. The following MR fixes this bug, but
  hits the 404 issue with twitter links in facebook posts:
  https://code.launchpad.net/~osomon/webbrowser-app/filter-session-
  storage-url-save/+merge/231204.

To manage notifications about this bug go to:
https://bugs.launchpad.net/webapps-core/+bug/1358622/+subscriptions

-- 
Mailing list: https://launchpad.net/~ubuntu-webapps-bugs
Post to : ubuntu-webapps-bugs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-webapps-bugs
More help   : https://help.launchpad.net/ListHelp