Early support for Jetty 12 (developed against 12.0.0.alpha2)

Reflective getHeaders calls to be revisited; see GitHub issue #8938 in Jetty project.
HttpOutput optimization commented out still in order to avoid alpha build dependency.

See gh-29575
This commit is contained in:
Juergen Hoeller
2022-11-25 17:04:48 +01:00
parent 4ff18741fd
commit 45d45c2989
8 changed files with 109 additions and 35 deletions

View File

@@ -20,6 +20,7 @@ import java.io.ByteArrayOutputStream;
import java.net.URI;
import java.nio.ByteBuffer;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.concurrent.CompletableFuture;
import org.eclipse.jetty.client.HttpClient;
@@ -171,9 +172,9 @@ public class JettyXhrTransport extends AbstractXhrTransport implements Lifecycle
private static HttpHeaders toHttpHeaders(HttpFields httpFields) {
HttpHeaders responseHeaders = new HttpHeaders();
Enumeration<String> names = httpFields.getFieldNames();
while (names.hasMoreElements()) {
String name = names.nextElement();
Iterator<String> names = httpFields.getFieldNamesCollection().iterator();
while (names.hasNext()) {
String name = names.next();
Enumeration<String> values = httpFields.getValues(name);
while (values.hasMoreElements()) {
String value = values.nextElement();