🔥 Removing code or files. remove zipkin code

This commit is contained in:
冷冷 committed 2019-04-28 13:41:35 +08:00
1 parent c11757d455
commit c232239ae6
19 files changed
+2499 -1715

No files matched your search

@@ -18,7 +18,6 @@
package com.pig4cloud.pigx.gateway.filter;
import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
import com.pig4cloud.pigx.gateway.config.SwaggerProvider;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.core.Ordered;
@@ -47,7 +46,6 @@ import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.a
*/
@Component
public class PigxRequestGlobalFilter implements GlobalFilter, Ordered {
private static final String HEADER_NAME = "X-Forwarded-Prefix";
/**
* Process the Web request and (optionally) delegate to the next
@@ -74,16 +72,9 @@ public class PigxRequestGlobalFilter implements GlobalFilter, Ordered {
.build();
exchange.getAttributes().put(GATEWAY_REQUEST_URL_ATTR, newRequest.getURI());
// 3. 支持swagger添加X-Forwarded-Prefix header
String path = request.getURI().getPath();
if (!StringUtils.endsWithIgnoreCase(path, SwaggerProvider.API_URI)) {
return chain.filter(exchange.mutate().request(newRequest).build());
}
String basePath = path.substring(0, path.lastIndexOf(SwaggerProvider.API_URI));
return chain.filter(exchange.mutate()
.request(newRequest.mutate()
.header(HEADER_NAME, basePath)
.build()).build());
.request(newRequest.mutate()
.build()).build());
}
@Override