mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8133686: HttpURLConnection.getHeaderFields and URLConnection.getRequestProperties methods return field values in reverse order
Reviewed-by: dfuchs
This commit is contained in:
parent
aa9311182a
commit
00e059ddb3
7 changed files with 388 additions and 46 deletions
|
@ -589,6 +589,14 @@ public abstract class URLConnection {
|
|||
* unmodifiable List of Strings that represents
|
||||
* the corresponding field values.
|
||||
*
|
||||
* This method is overridden by the subclasses of {@code URLConnection}.
|
||||
*
|
||||
* In the implementation of these methods, if a given key has multiple
|
||||
* corresponding values, they must be returned in the order they were added,
|
||||
* preserving the insertion-order.
|
||||
*
|
||||
* @implSpec The default implementation of this method returns an empty map always.
|
||||
*
|
||||
* @return a Map of header fields
|
||||
* @since 1.4
|
||||
*/
|
||||
|
@ -1134,6 +1142,10 @@ public abstract class URLConnection {
|
|||
* key-value pair. This method will not overwrite
|
||||
* existing values associated with the same key.
|
||||
*
|
||||
* This method could be a no-op if appending a value
|
||||
* to the map is not supported by the protocol being
|
||||
* used in a given subclass.
|
||||
*
|
||||
* @param key the keyword by which the request is known
|
||||
* (e.g., "{@code Accept}").
|
||||
* @param value the value associated with it.
|
||||
|
@ -1181,6 +1193,16 @@ public abstract class URLConnection {
|
|||
* of Strings that represents the corresponding
|
||||
* field values.
|
||||
*
|
||||
* If multiple values for a given key are added via the
|
||||
* {@link #addRequestProperty(String, String)} method,
|
||||
* these values will be returned in the order they were
|
||||
* added. This method must preserve the insertion order
|
||||
* of such values.
|
||||
*
|
||||
* The default implementation of this method preserves the insertion order when
|
||||
* multiple values are added for a given key. The values are returned in the order they
|
||||
* were added.
|
||||
*
|
||||
* @return a Map of the general request properties for this connection.
|
||||
* @throws IllegalStateException if already connected
|
||||
* @since 1.4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue