Skip to content

Commit

Permalink
Merge pull request #56 from dulanjalidilmi/issue-712
Browse files Browse the repository at this point in the history
Enrich only post and patch requests
  • Loading branch information
dulanjalidilmi authored Sep 12, 2022
2 parents 6bfa3ec + 80b5f40 commit ff752d3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<groupId>org.wso2.carbon.connector</groupId>
<artifactId>org.wso2.carbon.connector.salesforcerest</artifactId>
<packaging>jar</packaging>
<version>1.1.2</version>
<version>1.1.3</version>
<name>WSO2 Carbon - Mediation Library Connector For Salesforcerest</name>
<url>http://wso2.org</url>
<profiles>
Expand Down
20 changes: 12 additions & 8 deletions src/main/resources/salesforcerest-config/init.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@
<filter source="boolean($ctx:uri.var.username) and boolean($ctx:uri.var.password) and boolean($ctx:uri.var.clientSecret) and boolean($ctx:uri.var.clientId)"
regex="true">
<then>
<enrich>
<source clone="true" type="body"/>
<target property="ORIGINAL_MSG_PAYLOAD" type="property"/>
</enrich>
<filter source="$ctx:httpMethod" regex="(post|patch)">
<enrich>
<source clone="true" type="body"/>
<target property="ORIGINAL_MSG_PAYLOAD" type="property"/>
</enrich>
</filter>
<property name="Accept-Encoding" scope="transport" action="remove"/>
<property name="NO_ENTITY_BODY" value="true" type="BOOLEAN" scope="axis2"/>
<payloadFactory media-type="json">
Expand Down Expand Up @@ -123,10 +125,12 @@
</else>
</filter>
<property name="uri.var.accessToken" expression="json-eval($.access_token)"/>
<enrich>
<source clone="true" property="ORIGINAL_MSG_PAYLOAD" type="property"/>
<target type="body"/>
</enrich>
<filter source="$ctx:httpMethod" regex="(post|patch)">
<enrich>
<source clone="true" property="ORIGINAL_MSG_PAYLOAD" type="property"/>
<target type="body"/>
</enrich>
</filter>
</then>
</filter>
</sequence>
Expand Down

0 comments on commit ff752d3

Please sign in to comment.