RFR: 8029354: URLPermission.<init> throws llegalArgumentException: Invalid characters in hostname

Michael McMahon michael.x.mcmahon at oracle.com
Mon Dec 2 02:00:54 PST 2013


Max,

Thanks for reviewing.

On 02/12/13 08:29, Weijun Wang wrote:
> Hi Michael
>
>  492         boolean implies(Authority other) {
>  493             return userinfo.equals(other.userinfo) &&
>  494                    impliesHostrange(other) && 
> impliesPortrange(other);
>  495         }
>
> This means http://example.com does not imply 
> http://someone@example.com. Is this intended?
>

It was intended, though I admit the point is debatable. My conclusion 
was it would be
better to have an explicit syntax like http://*@example.com to mean all 
users @ example.com
rather than just assuming that the commonly used syntax 
http://example.com means (implies)
all users. But, I decided against adding the '*' syntax in the initial 
version of the class.
as I'm not sure how commonly used the userinfo actually is.

> Also,
>
>   68  * <i>userinfo</i> is optional and has no special significance in 
> this class.
>
> It seems that field has some significance.
>

The point I was trying to convey was that userinfo is just treated as an 
opaque component
but the wording is too vague, I agree.

I need to think about your first point some more and will come back with 
a proposal.

Thanks
Michael

> Thanks
> Max
>
>
>
> On 11/30/13, 1:06, Michael McMahon wrote:
>> Hi,
>>
>> java.net.URLPermission does not currently take account of the "userinfo"
>> component
>> in the authority of a URL. So, it does not accept URLs of the form
>> "http://username@host/blah"
>>
>> http://cr.openjdk.java.net/~michaelm/8029354/webrev.1/
>>
>> which includes a small spec change to account for this. Userinfo needs
>> to be case-sensitive
>> for comparison, hashCode() etc.
>>
>> Thanks,
>> Michael
>>
>>




More information about the net-dev mailing list