fix - fix starter_decode

This commit is contained in:
wangli 2025-04-22 20:23:17 +08:00
parent 5ccf15b2ce
commit fbb5c76737
2 changed files with 6 additions and 2 deletions

View File

@ -24,12 +24,16 @@ public class WorkflowRequestInterceptor implements RequestInterceptor {
public static final String HEADER_HTTP_CLIENT_VALUE = "WorkflowEngine-Feign";
public static final String HEADER_API_VERSION = "Service-Version";
public static final String HEADER_SERVER_NAME = "X-SERVER-NAME";
public static final String HEADER_W_E = "WE";
@Override
public void apply(RequestTemplate requestTemplate) {
Target.HardCodedTarget target = (Target.HardCodedTarget) requestTemplate.feignTarget();
String apiClassPath = target.type().getName();
if (apiClassPath.startsWith("cn.axzo.workflow")) {
requestTemplate.header(HEADER_W_E, "true");
}
if (apiClassPath.contains("cn.axzo.workflow.client.feign.bpmn")
|| apiClassPath.contains("cn.axzo.workflow.client.feign.manage")) {
requestTemplate.header(HEADER_HTTP_CLIENT, HEADER_HTTP_CLIENT_VALUE);

View File

@ -21,7 +21,7 @@ import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import static cn.axzo.workflow.common.constant.StarterConstants.STARTER_INVOKE_MODE;
import static cn.axzo.workflow.client.config.WorkflowRequestInterceptor.HEADER_W_E;
/**
* Workflow Engine Starter Complex Invoke Client Decoder
@ -59,7 +59,7 @@ final class WorkflowEngineStarterDecoder implements Decoder {
}
Object convertWrapper(Response response, Type enclosedType) throws IOException {
if (response.request().headers().containsKey(STARTER_INVOKE_MODE)) {
if (response.request().headers().containsKey(HEADER_W_E)) {
return delegate.decode(response, enclosedType);
} else {
return convert(response, enclosedType);