This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5536 - Better handling of URISyntaxException
Summary: Better handling of URISyntaxException
Status: RESOLVED FIXED
Alias: None
Product: mobileOK Basic checker
Classification: Unclassified
Component: Java Library (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Sean Owen
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-06 16:27 UTC by Dominique Hazael-Massieux
Modified: 2008-04-01 04:12 UTC (History)
0 users

See Also:


Attachments

Description Dominique Hazael-Massieux 2008-03-06 16:27:22 UTC
In CSSUtils and HTTPXHTMLResource, when we encounter a URI, we get it to be parsed using new URI(), which sometimes throw a URISyntaxException.
Currently, the only thing that happens where that exception is thrown is a log line that never gets seen by the end-user.

There are 2 problems:
 * the URI construct throws URISyntaxException for URIs that most browsers don't have a problem dealing with; typically, if the "|" character in the URI. This means there are images that we don't check due to this limitation ; maybe we could %-encode the list of "unwise" characters in RFC2396 as part of the pre-processing to avoid that problem?
 * for URIs that we really can't parse (or if we don't implement the above), instead of using log.info(), we should report the URI parsing problem as a HTTP_RESPONSE-1 issue
Comment 1 Sean Owen 2008-03-07 15:26:35 UTC
Partially fixed -- I added new code to catch URISyntaxException where it occurs from the URI constructor, rewrite the URL escaping "unwise" characters, and try again.
Comment 2 Sean Owen 2008-04-01 04:12:19 UTC
I committed a hack-ish solution to this. It forms a valid but non-existent URL out of a badly formed URL, which induces a failure later. This is really a corner case so I am basically OK with a hacky solution. I think we don't need to spend a lot of effort complicating moki.xml and the code to handle this differently.