Skip to content

Commit

Permalink
[SCB-1278] add comment on Microservice#thirdPartyService, change conf…
Browse files Browse the repository at this point in the history
…ig key of clientRequestHeaderFilterEnabled
  • Loading branch information
yhs0092 authored and liubao68 committed May 30, 2019
1 parent d894842 commit aafc487
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ public class OperationConfig {
/**
* whether to remove certain headers from the 3rd party invocations
*/
@InjectProperty(keys = {"request.${op-any-priority}.clientRequestHeaderFilterEnabled",
"request.clientRequestHeaderFilterEnabled"}, defaultValue = "true")
@InjectProperty(keys = {"request.clientRequestHeaderFilterEnabled${consumer-op-priority}"}, defaultValue = "true")
private boolean clientRequestHeaderFilterEnabled = true;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,18 @@ public void testExposeServiceCombHeaders() {
// user defined header, even though start with x-cse, will not be removed
Assert.assertThat(response, Matchers.contains("host", "x-cse-test", "x-cse-test2"));

ArchaiusUtils.setProperty("servicecomb.request.3rdPartyDataTypeJaxrs.clientRequestHeaderFilterEnabled", "false");
ArchaiusUtils.setProperty("servicecomb.request.clientRequestHeaderFilterEnabled", "false");
response = dataTypeJaxrsSchema.getRequestHeaders(testParam, testParam2);
Assert.assertThat(response,
Matchers.contains("host", "x-cse-context", "x-cse-target-microservice", "x-cse-test", "x-cse-test2"));

ArchaiusUtils.setProperty("servicecomb.request.3rdPartyDataTypeJaxrs.clientRequestHeaderFilterEnabled", "true");
ArchaiusUtils.setProperty("servicecomb.request.clientRequestHeaderFilterEnabled", "true");
ArchaiusUtils.setProperty("servicecomb.request.clientRequestHeaderFilterEnabled.3rdPartyDataTypeJaxrs", "false");
response = dataTypeJaxrsSchema.getRequestHeaders(testParam, testParam2);
Assert.assertThat(response,
Matchers.contains("host", "x-cse-context", "x-cse-target-microservice", "x-cse-test", "x-cse-test2"));

ArchaiusUtils.setProperty("servicecomb.request.clientRequestHeaderFilterEnabled.3rdPartyDataTypeJaxrs", "true");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ public class Microservice {
@JsonIgnore
private MicroserviceInstance instance;

/**
* Currently this field only exists in ServiceComb-Java-Chassis,
* and ServiceComb-Service-Center does not hold this field.
* Once the 3rd party services are supported to be registered into ServiceComb-Service-Center,
* the corresponding field should be added into Service-Center.
*/
private boolean thirdPartyService;

public Microservice() {
Expand Down

0 comments on commit aafc487

Please sign in to comment.