Skip to content

Commit 4d54416

Browse files
chenzhiguoseasidesky
authored andcommitted
Fix the bug of extracting request cookie in Spring Cloud Gateway adapter (alibaba#1400)
1 parent b91b623 commit 4d54416

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public String getUrlParam(ServerWebExchange exchange, String paramName) {
5555

5656
@Override
5757
public String getCookieValue(ServerWebExchange exchange, String cookieName) {
58-
return Optional.ofNullable(exchange.getResponse().getCookies().getFirst(cookieName))
58+
return Optional.ofNullable(exchange.getRequest().getCookies().getFirst(cookieName))
5959
.map(HttpCookie::getValue)
6060
.orElse(null);
6161
}

0 commit comments

Comments
 (0)