mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-11 05:19:00 +08:00
🔥 Removing code or files. remove zipkin code
This commit is contained in:
1 parent
c11757d455
commit
c232239ae6
19 files changed
+2499
-1715
No files matched your search
+2
-11
@@ -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
|
||||
|
||||
Reference in new issue
Block a user