RFR: 8087112: HTTP API and HTTP/1.1 implementation
Michael McMahon
michael.x.mcmahon at oracle.com
Tue Sep 29 11:21:38 UTC 2015
Anthony,
Thanks for the feedback. I am currently looking at API issues
but will incorporate these changes when I get back to the implementation.
- Michael
On 27/09/15 09:14, Anthony Vanelverdinghe wrote:
> Hi Michael
>
> I forgot to mention that, in Utils.java [1], the exception should also
> be thrown in case token is the empty string. And while I'm nitpicking
> anyway: here 's an alternative implementation which extracts the
> comparison logic in a separate method:
>
> static void validateToken(String token, String errormsg) {
> if (token.isEmpty() || token.chars().anyMatch(c -> !isTchar(c))) {
> throw new IllegalArgumentException(errormsg);
> }
> }
>
> private static boolean isTchar(int c) {
> return c >= 0x30 && c <= 0x39 // 0 - 9
> || (c >= 0x61 && c <= 0x7a) // a - z
> || (c >= 0x41 && c <= 0x5a) // A - Z
> || (c >= 0x21 && c <= 0x2e && c != 0x22 && c != 0x28 && c
> != 0x29 && c != 0x2c)
> || (c >= 0x5e && c <= 0x60)
> || (c == 0x7c) || (c == 0x7e);
> }
>
> PS: I have signed the OCA [2], so you can reuse any code if you wish
>
> [1]
> http://cr.openjdk.java.net/~michaelm/8087112/01/src/java.base/share/classes/sun/net/httpclient/Utils.java.html
> [2] http://www.oracle.com/technetwork/community/oca-486395.html#v
>
> Kind regards,
> Anthony
>
>
> On 25/09/2015 21:59, Anthony Vanelverdinghe wrote:
>> Hi Michael
>>
>> Maybe these have been fixed in the meantime, but I think I've found a
>> bug:
>> in
>> http://cr.openjdk.java.net/~michaelm/8087112/01/src/java.base/share/classes/sun/net/httpclient/Utils.java.html
>> single quotes must be accepted, while parentheses must be rejected [1]
>>
>> and a few typos:
>> in
>> http://cr.openjdk.java.net/~michaelm/8087112/01/src/java.base/share/classes/sun/net/httpclient/SSLTunnelConnection.java.html
>> at line 56, replace
>> return connected & delegate.connected();
>> with
>> return connected && delegate.connected();
>>
>> in
>> http://cr.openjdk.java.net/~michaelm/8087112/01/src/java.base/share/classes/java/net/package-info.java.udiff.html
>> replace "superceded" with "superseded"
>>
>> On a final note, when will the new API be integrated in the weekly
>> early access builds [2]?
>>
>> [1] https://tools.ietf.org/html/rfc7230#section-3.2.6
>> [2] https://jdk9.java.net/download/
>>
>> Kind regards
>> Anthony
>>
More information about the net-dev
mailing list