Browse Source

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

master
Zhiguo.Chen GitHub 4 years ago
parent
commit
7c361aab13
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      sentinel-adapter/sentinel-spring-cloud-gateway-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/gateway/sc/ServerWebExchangeItemParser.java

+ 1
- 1
sentinel-adapter/sentinel-spring-cloud-gateway-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/gateway/sc/ServerWebExchangeItemParser.java View File

@@ -55,7 +55,7 @@ public class ServerWebExchangeItemParser implements RequestItemParser<ServerWebE

@Override
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)
.orElse(null);
}


Loading…
Cancel
Save