Skip to content

Commit

Permalink
[#1110] fixed serviceName config is not effective for instanceIsolati…
Browse files Browse the repository at this point in the history
…on policy (#1112)
  • Loading branch information
chengyouling authored Nov 27, 2023
1 parent f58153f commit f058477
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package com.huaweicloud.governance.adapters.web;

import org.apache.servicecomb.governance.marker.GovernanceRequestExtractor;
import org.springframework.cloud.client.loadbalancer.ServiceRequestWrapper;
import org.springframework.http.HttpRequest;

import com.huaweicloud.common.context.InvocationContextHolder;
Expand Down Expand Up @@ -58,6 +59,9 @@ public String instanceId() {

@Override
public String serviceName() {
if (request instanceof ServiceRequestWrapper) {
return ((ServiceRequestWrapper) request).getRequest().getURI().getHost();
}
return request.getURI().getHost();
}

Expand Down

0 comments on commit f058477

Please sign in to comment.