Fix the bug of extracting request cookie in Spring Cloud Gateway adapter (#1400)

This commit is contained in:
Zhiguo.Chen 2020-04-13 19:35:14 +08:00 committed by GitHub
parent 6a7ec708bc
commit 7c361aab13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ public class ServerWebExchangeItemParser implements RequestItemParser<ServerWebE
@Override @Override
public String getCookieValue(ServerWebExchange exchange, String cookieName) { public String getCookieValue(ServerWebExchange exchange, String cookieName) {
return Optional.ofNullable(exchange.getResponse().getCookies().getFirst(cookieName)) return Optional.ofNullable(exchange.getRequest().getCookies().getFirst(cookieName))
.map(HttpCookie::getValue) .map(HttpCookie::getValue)
.orElse(null); .orElse(null);
} }