simplify lambda expression

This commit is contained in:
igor-suhorukov 2018-03-09 00:17:44 +03:00 committed by Juergen Hoeller
parent 2f9d0a7de8
commit 58a5138f26
1 changed files with 3 additions and 5 deletions

View File

@ -76,16 +76,14 @@ class ReactorClientHttpResponse implements ClientHttpResponse {
public MultiValueMap<String, ResponseCookie> getCookies() {
MultiValueMap<String, ResponseCookie> result = new LinkedMultiValueMap<>();
this.response.cookies().values().stream().flatMap(Collection::stream)
.forEach(cookie -> {
ResponseCookie responseCookie = ResponseCookie.from(cookie.name(), cookie.value())
.forEach(cookie ->
result.add(cookie.name(), ResponseCookie.from(cookie.name(), cookie.value())
.domain(cookie.domain())
.path(cookie.path())
.maxAge(cookie.maxAge())
.secure(cookie.isSecure())
.httpOnly(cookie.isHttpOnly())
.build();
result.add(cookie.name(), responseCookie);
});
.build()));
return CollectionUtils.unmodifiableMultiValueMap(result);
}