mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
remove duplicate entry when request path is empty
This commit is contained in:
parent
ba101f479e
commit
46e4d71b22
@ -62,11 +62,17 @@ public class SentinelProtectInterceptor implements ClientHttpRequestInterceptor
|
||||
String hostResource = uri.getScheme() + "://" + uri.getHost()
|
||||
+ (uri.getPort() == -1 ? "" : ":" + uri.getPort());
|
||||
String hostWithPathResource = hostResource + uri.getPath();
|
||||
boolean entryWithPath = true;
|
||||
if (hostResource.equals(hostWithPathResource)) {
|
||||
entryWithPath = false;
|
||||
}
|
||||
Entry hostEntry = null, hostWithPathEntry = null;
|
||||
ClientHttpResponse response;
|
||||
try {
|
||||
ContextUtil.enter(hostWithPathResource);
|
||||
ContextUtil.enter(hostResource);
|
||||
if (entryWithPath) {
|
||||
hostWithPathEntry = SphU.entry(hostWithPathResource);
|
||||
}
|
||||
hostEntry = SphU.entry(hostResource);
|
||||
response = execution.execute(request, body);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user