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()
|
String hostResource = uri.getScheme() + "://" + uri.getHost()
|
||||||
+ (uri.getPort() == -1 ? "" : ":" + uri.getPort());
|
+ (uri.getPort() == -1 ? "" : ":" + uri.getPort());
|
||||||
String hostWithPathResource = hostResource + uri.getPath();
|
String hostWithPathResource = hostResource + uri.getPath();
|
||||||
|
boolean entryWithPath = true;
|
||||||
|
if (hostResource.equals(hostWithPathResource)) {
|
||||||
|
entryWithPath = false;
|
||||||
|
}
|
||||||
Entry hostEntry = null, hostWithPathEntry = null;
|
Entry hostEntry = null, hostWithPathEntry = null;
|
||||||
ClientHttpResponse response;
|
ClientHttpResponse response;
|
||||||
try {
|
try {
|
||||||
ContextUtil.enter(hostWithPathResource);
|
ContextUtil.enter(hostResource);
|
||||||
|
if (entryWithPath) {
|
||||||
hostWithPathEntry = SphU.entry(hostWithPathResource);
|
hostWithPathEntry = SphU.entry(hostWithPathResource);
|
||||||
|
}
|
||||||
hostEntry = SphU.entry(hostResource);
|
hostEntry = SphU.entry(hostResource);
|
||||||
response = execution.execute(request, body);
|
response = execution.execute(request, body);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user