Upgrade to Undertow 2.2 (and R2DBC Arabba-SR7)

This commit is contained in:
Juergen Hoeller
2020-09-14 22:59:46 +02:00
parent 6e3ed6038b
commit b8c12a3aa1
3 changed files with 6 additions and 2 deletions

View File

@@ -77,9 +77,11 @@ class UndertowServerHttpRequest extends AbstractServerHttpRequest {
return this.exchange.getRequestMethod().toString();
}
@SuppressWarnings("deprecation")
@Override
protected MultiValueMap<String, HttpCookie> initCookies() {
MultiValueMap<String, HttpCookie> cookies = new LinkedMultiValueMap<>();
// getRequestCookies() is deprecated in Undertow 2.2
for (String name : this.exchange.getRequestCookies().keySet()) {
Cookie cookie = this.exchange.getRequestCookies().get(name);
HttpCookie httpCookie = new HttpCookie(name, cookie.getValue());

View File

@@ -104,6 +104,7 @@ class UndertowServerHttpResponse extends AbstractListenerServerHttpResponse impl
protected void applyHeaders() {
}
@SuppressWarnings("deprecation")
@Override
protected void applyCookies() {
for (String name : getCookies().keySet()) {
@@ -121,6 +122,7 @@ class UndertowServerHttpResponse extends AbstractListenerServerHttpResponse impl
cookie.setSecure(httpCookie.isSecure());
cookie.setHttpOnly(httpCookie.isHttpOnly());
cookie.setSameSiteMode(httpCookie.getSameSite());
// getResponseCookies() is deprecated in Undertow 2.2
this.exchange.getResponseCookies().putIfAbsent(name, cookie);
}
}