8133686: HttpURLConnection.getHeaderFields and URLConnection.getRequestProperties methods return field values in reverse order

Reviewed-by: dfuchs
This commit is contained in:
Evan Whelan 2021-09-09 10:23:12 +00:00 committed by Daniel Fuchs
parent aa9311182a
commit 00e059ddb3
7 changed files with 388 additions and 46 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -245,7 +245,7 @@ class MessageHeader {
String[] excludeList, Map<String, List<String>> include) {
boolean skipIt = false;
Map<String, List<String>> m = new HashMap<>();
for (int i = nkeys; --i >= 0;) {
for (int i = 0; i < nkeys; i++) {
if (excludeList != null) {
// check if the key is in the excludeList.
// if so, don't include it in the Map.