Closed Bug 1064397 Opened 10 years ago Closed 10 years ago

CardsHelper.getIconURIForApp returns bad url given an absolute, off-origin URL

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S4 (12sep)

People

(Reporter: sfoster, Assigned: sfoster)

References

Details

(Whiteboard: [systemsfe])

Attachments

(1 file, 1 obsolete file)

e.me apps return a .icon url like "http://api.everything.me/partners/1.0/Icon/get?id=26&iconFormat=20&apiKey=...", which is getting badly resolved/concat-ed with the app origin to produce "http://wikipedia.flyapps.mehttp://api.everything.me/partners/1.0/Icon/get?id=26&iconFormat=20&apiKey=..."
Rather than assuming all non-data URIs are relative paths, this change explicitly checks for leading '/' - which is the only expected and handled case in this block. 

The getOriginObject a) wasnt used outside this file, and b) was really just returning a URL-like hash with protocol etc. properties. So I got rid of it in favour of using URL.
Attachment #8485851 - Flags: review?(etienne)
Comment on attachment 8485851 [details] [review]
Fix handling for absolute icon URLs used by e.me app windows

lgtm :)
Attachment #8485851 - Flags: review?(etienne) → review+
Merged to master: https://github.com/mozilla-b2g/gaia/commit/cebf9e694d4536fbc4012a1fe1f60d31adf8e628
Original commit: https://github.com/mozilla-b2g/gaia/commit/0294015fca59f4f8d08ae8c946c7a3fccce32310

..but I was looking at the wrong tbpl results. Will backout and try again shortly.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Backed out: https://github.com/mozilla-b2g/gaia/commit/46e35fd6adc8f89d1b058ff84312cb38242c4658
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Blocks: 1061324
Carrying Etienne's r+, this PR fixes unit tests by handling empty src urls which get passed in the tests.
Attachment #8485851 - Attachment is obsolete: true
Attachment #8485971 - Flags: review+
Assignee: nobody → sfoster
Target Milestone: --- → 2.1 S4 (12sep)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: