RFR: 8133686: HttpURLConnection.getHeaderFields and URLConnection.getRequestProperties methods return field values in reverse order [v2]
Chris Hegarty
chegar at openjdk.java.net
Mon Feb 8 10:41:47 UTC 2021
On Fri, 29 Jan 2021 11:03:07 GMT, Evan Whelan <ewhelan at openjdk.org> wrote:
>> Hi all,
>>
>> Please review this fix for which corrects the order in which field values are returned from the `HttpURLConnection.getHeaderFields` and `URLConnection.getRequestProperties` methods.
>>
>> Currently, the implementation of these methods returns the values in reverse. This does not conform with the RFC2616 spec which outlines that the order of these field values should not be changed.
>>
>> Thanks,
>> Evan
>
> Evan Whelan has updated the pull request incrementally with one additional commit since the last revision:
>
> URLConnection doc fixes
Changes requested by chegar (Reviewer).
src/java.base/share/classes/java/net/URLConnection.java line 1147:
> 1145: * to the map is not supported by the protocol being
> 1146: * used in a given subclass.
> 1147: *
I'm not sure about this. What is the use-case driving this clarification? Is it just for the corner case where the default implementation of getHeaderFields is not overridden ?
src/java.base/share/classes/java/net/URLConnection.java line 1200:
> 1198: * added. This method must preserve the insertion order
> 1199: * of such values.
> 1200: *
But we have made addRequestProperty effectively a no-op ( as above ) !
-------------
PR: https://git.openjdk.java.net/jdk/pull/2294
More information about the net-dev
mailing list