On 2009/07/07 18:20:34, MikeSamuel wrote:
http://codereview.appspot.com/88118/diff/1/3
File src/com/google/caja/lexer/escaping/UriUtil.java (right):

http://codereview.appspot.com/88118/diff/1/3#newcode103
Line 103: if (path.length() != 0 || authority != null) {
Checking whether the authority is null is not the right way to check
whether a
URL is opaque.  That depends on the scheme.

Can we assume that it is opaque iff if the scheme is in a set of known
opaque
URL schemes?
Maybe construct a case-insensitive TreeSet<String> containing
("mailto", "data",
"javascript").

according to
http://java.sun.com/j2se/1.5.0/docs/api/java/net/URI.html

a URI is opaque if
1. it's absolute, ie, it specifies a scheme, and
2. the scheme-specific part does not begin with '/'

I was working off that description, but now that I
think about it, the language may be misleading,
since it implies that "http:foo" is opaque.

I'll check the rfc and browser behavior.



http://codereview.appspot.com/88118

Reply via email to