Upgrade to Jetty 12.0.17 and Jetty Reactive HttpClient 4.0.9
Includes Apache HttpClient 5.4.1, Netty 4.1.119, Jackson 2.18.3, Gson 2.12.1, FreeMarker 2.3.34, Protobuf 4.30, Groovy 4.0.26, Jython 2.7.4, JRuby 9.4.12, Caffeine 3.2, QDox 2.2, Awaitility 4.3, EasyMock 5.5, HtmlUnit 4.10 Closes gh-34561
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -43,6 +43,7 @@ public class JettyCoreHttpHandlerAdapter extends Handler.Abstract.NonBlocking {
|
||||
this.httpHandler = httpHandler;
|
||||
}
|
||||
|
||||
|
||||
public void setDataBufferFactory(JettyDataBufferFactory dataBufferFactory) {
|
||||
Assert.notNull(dataBufferFactory, "DataBufferFactory must not be null");
|
||||
this.dataBufferFactory = dataBufferFactory;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -61,6 +61,7 @@ class JettyCoreServerHttpRequest extends AbstractServerHttpRequest {
|
||||
this.request = request;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected MultiValueMap<String, HttpCookie> initCookies() {
|
||||
List<org.eclipse.jetty.http.HttpCookie> httpCookies = Request.getCookies(this.request);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -59,10 +59,10 @@ class JettyCoreServerHttpResponse extends AbstractServerHttpResponse implements
|
||||
super(dataBufferFactory, new HttpHeaders(new JettyHeadersAdapter(response.getHeaders())));
|
||||
this.response = response;
|
||||
|
||||
// remove all existing cookies from the response and add them to the cookie map, to be added back later
|
||||
for (ListIterator<HttpField> i = this.response.getHeaders().listIterator(); i.hasNext(); ) {
|
||||
HttpField f = i.next();
|
||||
if (f instanceof HttpCookieUtils.SetCookieHttpField setCookieHttpField) {
|
||||
// Remove all existing cookies from the response and add them to the cookie map, to be added back later
|
||||
for (ListIterator<HttpField> it = this.response.getHeaders().listIterator(); it.hasNext();) {
|
||||
HttpField field = it.next();
|
||||
if (field instanceof HttpCookieUtils.SetCookieHttpField setCookieHttpField) {
|
||||
HttpCookie httpCookie = setCookieHttpField.getHttpCookie();
|
||||
ResponseCookie responseCookie = ResponseCookie.from(httpCookie.getName(), httpCookie.getValue())
|
||||
.httpOnly(httpCookie.isHttpOnly())
|
||||
@@ -72,8 +72,8 @@ class JettyCoreServerHttpResponse extends AbstractServerHttpResponse implements
|
||||
.secure(httpCookie.isSecure())
|
||||
.partitioned(httpCookie.isPartitioned())
|
||||
.build();
|
||||
this.addCookie(responseCookie);
|
||||
i.remove();
|
||||
addCookie(responseCookie);
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,9 @@ class JettyCoreServerHttpResponse extends AbstractServerHttpResponse implements
|
||||
@Override
|
||||
protected void applyStatusCode() {
|
||||
HttpStatusCode status = getStatusCode();
|
||||
this.response.setStatus(status == null ? 0 : status.value());
|
||||
if (status != null){
|
||||
this.response.setStatus(status.value());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -103,7 +105,7 @@ class JettyCoreServerHttpResponse extends AbstractServerHttpResponse implements
|
||||
|
||||
@Override
|
||||
protected void applyCookies() {
|
||||
this.getCookies().values().stream()
|
||||
getCookies().values().stream()
|
||||
.flatMap(List::stream)
|
||||
.forEach(cookie -> Response.addCookie(this.response, new ResponseHttpCookie(cookie)));
|
||||
}
|
||||
@@ -165,12 +167,10 @@ class JettyCoreServerHttpResponse extends AbstractServerHttpResponse implements
|
||||
|
||||
private final ResponseCookie responseCookie;
|
||||
|
||||
|
||||
ResponseHttpCookie(ResponseCookie responseCookie) {
|
||||
this.responseCookie = responseCookie;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.responseCookie.getName();
|
||||
@@ -235,7 +235,6 @@ class JettyCoreServerHttpResponse extends AbstractServerHttpResponse implements
|
||||
public Map<String, String> getAttributes() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user