Преглед изворни кода

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

master
Zhiguo.Chen GitHub пре 4 година
родитељ
комит
7c361aab13
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 измењених фајлова са 1 додато и 1 уклоњено
  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 Прегледај датотеку

@@ -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…
Откажи
Сачувај