Commit 68c233c2 authored by harshit aggarwal's avatar harshit aggarwal
Browse files

minor fix in RestClient

parent 9ecbfbdf
Pipeline #21800 passed with stages
in 12 minutes and 29 seconds
......@@ -51,8 +51,8 @@ public class RestClient {
public RestResponse processRequest(RequestParameters requestParameters) {
HttpHeaders headers = setHeaders(requestParameters.getContent(), requestParameters.getAuthKey(),
requestParameters.getDataPartitionId(), requestParameters.getOnBehalfOf(),
requestParameters.getAppKey());
requestParameters.getDataPartitionId(), requestParameters.getCorrelationId(),
requestParameters.getOnBehalfOf(), requestParameters.getAppKey());
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
HttpEntity<?> request = new HttpEntity<>(requestParameters.getPayload(), headers);
try {
......@@ -72,8 +72,8 @@ public class RestClient {
}
}
private HttpHeaders setHeaders(String content, String authKey, String accountId, String onBehalfOf,
String appKey) {
private HttpHeaders setHeaders(String content, String authKey, String dataPartitionID,
String correlationID, String onBehalfOf, String appKey) {
HttpHeaders headers = new HttpHeaders();
String contentType;
......@@ -89,8 +89,12 @@ public class RestClient {
headers.set(Constants.AUTHORIZATION, authKey);
}
if (accountId != null) {
headers.set(Constants.DATA_PARTITION_ID, accountId);
if (dataPartitionID != null) {
headers.set(Constants.DATA_PARTITION_ID, dataPartitionID);
}
if (correlationID != null) {
headers.set(Constants.CORRELATION_ID, correlationID);
}
if (onBehalfOf != null) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment