Closed Bug 1249096 Opened 8 years ago Closed 8 years ago

Use a more forgiving URL parser when getting the fallback favicon

Categories

(Firefox for Android Graveyard :: Favicon Handling, defect)

All
Android
defect
Not set
normal

Tracking

(firefox47 fixed)

RESOLVED FIXED
Firefox 47
Tracking Status
firefox47 --- fixed

People

(Reporter: mfinkle, Assigned: mfinkle)

Details

Attachments

(1 file)

We try to use Java.net.URI to parse strings into URI pieces. This is certainly preferred over Java.net.URL which tries to make a network connection.

There are times where Java.net.URI is too strict. Browsers tend to be more forgiving and we end up losing data when trying to use Java.net.URI on a URL string loaded into the Browser.

An example is in favicons [1], where we try to create a "root" /favicon fallback based on a loaded page URL. If the URL is "http://example.com#foo#bar", then Java.net.URI will fail. This URL loads into Firefox just fine and we lose fetching the favicon.

Could we try using Android.net.Uri [2] which is much more forgiving? I also found a class in OkHTTP [3]

[1] http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/favicons/Favicons.java#523
[2] http://developer.android.com/reference/android/net/Uri.html
[3] https://corner.squareup.com/2015/05/okhttp-2-4.html
Switch to Android.net.Uri
Assignee: nobody → mark.finkle
Attachment #8720877 - Flags: review?(rnewman)
Attachment #8720877 - Flags: review?(rnewman) → review+
Status: NEW → ASSIGNED
OS: Unspecified → Android
Hardware: Unspecified → All
Version: unspecified → Trunk
Summary: Use a more forgiving URL parser in some situations → Use a more forgiving URL parser when getting the fallback favicon
I re-scoped this bug to the specific situation we found. We should file new bugs for other situations.
https://hg.mozilla.org/mozilla-central/rev/d6c06db9e3d4
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: