Skip to content

Commit

Permalink
Use Enumeration directly for Java8 compat
Browse files Browse the repository at this point in the history
(And need to figure why Animal Sniffer / Compiler Release 8 didn't catch that.)
  • Loading branch information
jhy committed Nov 2, 2023
1 parent edd5da4 commit 8227b49
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ protected void doIt(HttpServletRequest req, HttpServletResponse res) throws IOEx
.ignoreHttpErrors(true);

// request headers
for (Iterator<String> it = req.getHeaderNames().asIterator(); it.hasNext(); ) {
String name = it.next();
Enumeration<String> headerNames = req.getHeaderNames();
while (headerNames.hasMoreElements()) {
String name = headerNames.nextElement();
Enumeration<String> values = req.getHeaders(name);
for (Iterator<String> valuesIt = values.asIterator(); valuesIt.hasNext(); ) {
String value = valuesIt.next();
while (values.hasMoreElements()) {
String value = values.nextElement();
//System.out.println("Header: " + name + " = " + value);
fetch.header(name, value); // todo - this invocation will replace existing header, not add
}
Expand Down

0 comments on commit 8227b49

Please sign in to comment.