URL parsing doesn't comply with RFC 3986

Bug #1351222 reported by Tal Zion
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
URL Dispatcher
Fix Released
Medium
Ted Gould
dialer-app
Fix Released
High
Olivier Tilloy
dialer-app (Ubuntu)
Fix Released
Undecided
Unassigned
dialer-app (Ubuntu RTM)
Fix Released
Undecided
Unassigned
url-dispatcher (Ubuntu)
Fix Released
Undecided
Unassigned
url-dispatcher (Ubuntu RTM)
Fix Released
High
Unassigned

Bug Description

I tried opening a link without a path component (for example scheme:?param1=value1&param2=value2) and I got back an error from URL dispatcher "com.canonical.URLDispatcher.BadURL: URL 'scheme:?param1=value1&param2=value2' is not handleable by the URL Dispatcher".

I looked at the code, and it seems URL dispatcher parses URLs with the regex: ^(.*)://([a-z0-9\\.-]*)?/?(.*)?$
A URL doesn't have to look like that. Here is the URI grammar taken from the RFC:
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
hier-part = "//" authority path-abempty
            / path-absolute
            / path-rootless
            / path-empty

Links that can't currently be parsed by URL dispatcher are for example magnet links (used for torrents).
They look like: magnet:?xt=urn:ed2k:31D6CFE0D16AE931B73C59D7E0C089C0
&xl=0&dn=zero_len.fil
&xt=urn:bitprint:3I42H3S6NNFQ2MSVX7XZKYAYSCX5QBYJ
.LWPNACQDBZRYXW3VHJVCJ64QBZNGHOHHHZWCLNQ
&xt=urn:md5:D41D8CD98F00B204E9800998ECF8427E and therefore also can't be parsed by URL dispatcher.

Related branches

Tal Zion (talzion12)
summary: - Can't parse some valid URLs, declares them BadURL
+ URL parsing doesn't comply with RFC 3986
Tal Zion (talzion12)
description: updated
Ted Gould (ted)
Changed in url-dispatcher:
status: New → Confirmed
importance: Undecided → Medium
tags: added: rtm14
Olivier Tilloy (osomon)
Changed in url-dispatcher:
status: Confirmed → In Progress
assignee: nobody → Ted Gould (ted)
Changed in dialer-app:
assignee: nobody → Olivier Tilloy (osomon)
importance: Undecided → High
status: New → In Progress
tags: added: touch-2014-10-30
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package url-dispatcher - 0.1+15.04.20141031-0ubuntu1

---------------
url-dispatcher (0.1+15.04.20141031-0ubuntu1) vivid; urgency=low

  [ Ted Gould ]
  * Making generic regular expression more robust (LP: #1351222)

  [ Jussi Pakkanen ]
  * General cleanups
  * Do a rollback when update operations fail so there are no dangling
    transactions.
  * Ensure that tables always exist.
 -- Ubuntu daily release <email address hidden> Fri, 31 Oct 2014 15:51:36 +0000

Changed in url-dispatcher (Ubuntu):
status: New → Fix Released
Ted Gould (ted)
Changed in url-dispatcher:
status: In Progress → Fix Released
Changed in url-dispatcher (Ubuntu RTM):
status: New → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dialer-app - 0.1+15.04.20141106-0ubuntu1

---------------
dialer-app (0.1+15.04.20141106-0ubuntu1) vivid; urgency=low

  [ CI bot ]
  * Resync trunk

  [ Ubuntu daily release ]
  * New rebuild forced

  [ Olivier Tilloy ]
  * Also handle URLs of the form "tel:+1234567890", i.e. without slashes
    (those are common on web pages). (LP: #1351222)
 -- Ubuntu daily release <email address hidden> Thu, 06 Nov 2014 10:01:01 +0000

Changed in dialer-app (Ubuntu):
status: New → Fix Released
Olivier Tilloy (osomon)
Changed in dialer-app (Ubuntu RTM):
status: New → Confirmed
Olivier Tilloy (osomon)
Changed in dialer-app:
status: In Progress → Fix Released
Bill Filler (bfiller)
Changed in url-dispatcher (Ubuntu RTM):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package url-dispatcher - 0.1+15.04.20141208~rtm-0ubuntu1

---------------
url-dispatcher (0.1+15.04.20141208~rtm-0ubuntu1) 14.09; urgency=low

  [ Ted Gould ]
  * Making generic regular expression more robust (LP: #1384460,
    #1351222)
 -- Ubuntu daily release <email address hidden> Mon, 08 Dec 2014 17:44:20 +0000

Changed in url-dispatcher (Ubuntu RTM):
status: Triaged → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dialer-app - 0.1+15.04.20141208.1~rtm-0ubuntu1

---------------
dialer-app (0.1+15.04.20141208.1~rtm-0ubuntu1) 14.09; urgency=low

  [ Gustavo Pichorim Boiko ]
  * Hide the SIM selector when in emergency mode. (LP: #1379386)
  * Only set the CallManager.callIndicatorVisible flag when
    CallManager.hasCalls. (LP: #1390098)
  * Enable page to receive focus.
  * Add empty state in the history page. (LP: #1367325)

  [ Olivier Tilloy ]
  * Also handle URLs of the form "tel:+1234567890", i.e. without slashes
    (those are common on web pages). (LP: #1384460, #1351222)
 -- Ubuntu daily release <email address hidden> Mon, 08 Dec 2014 17:41:09 +0000

Changed in dialer-app (Ubuntu RTM):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.