|
|
@@ -4,6 +4,7 @@ import cn.reghao.bnt.log.GatewayLog;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.cloud.gateway.route.Route;
|
|
|
import org.springframework.cloud.gateway.support.ServerWebExchangeUtils;
|
|
|
+import org.springframework.http.HttpCookie;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
|
|
import org.springframework.http.server.reactive.ServerHttpResponse;
|
|
|
@@ -17,6 +18,7 @@ import java.net.URI;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author reghao
|
|
|
@@ -94,6 +96,12 @@ public class GatewayLogService {
|
|
|
//gatewayLog.setRemoteAddr(remote.getHostString());
|
|
|
gatewayLog.setRemotePort(remote.getPort());
|
|
|
}
|
|
|
+
|
|
|
+ Map<String, String> cookieMap = request.getCookies().values().stream()
|
|
|
+ .map(list -> list.get(0))
|
|
|
+ .collect(Collectors.toMap(HttpCookie::getName, HttpCookie::getValue));
|
|
|
+ String fingerprint = cookieMap.get("fp");
|
|
|
+ //System.out.printf("fingerprint -> %s\n", fingerprint);
|
|
|
}
|
|
|
|
|
|
private String getOriginalRequestUrl(ServerWebExchange exchange) {
|