Skip to content

Commit

Permalink
fix(headers) support multivaluated header values
Browse files Browse the repository at this point in the history
* values are separated with a `;`

Closes #30
  • Loading branch information
rbioteau committed Sep 3, 2018
1 parent 19a5738 commit c6a5375
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion infrastructure/release.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ timestamps {
credentialsId: 'github',
passwordVariable: 'GIT_PASSWORD',
usernameVariable: 'GIT_USERNAME')]) {
sh './mvnw release:prepare release:perform -B -DaltDeploymentRepository=${env.ALT_DEPLOYMENT_REPOSITORY_SNAPSHOTS}'
sh "./mvnw -B release:prepare release:perform -Darguments=-DaltDeploymentRepository=${env.ALT_DEPLOYMENT_REPOSITORY_TAG}"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,14 @@ private Map<String, String> asMap(Header[] headers) {
final Map<String, String> result = new HashMap<>();
if (headers != null) {
for (final Header header : headers) {
result.put(header.getName(), header.getValue());
String name = header.getName();
if (!result.containsKey(name)) {
result.put(name, header.getValue());
} else {
String currentValue = result.get(name);
if (header.getValue() != null && !header.getValue().isEmpty())
result.put(name, currentValue + ";" + header.getValue());
}
}
}
return result;
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/rest-delete.impl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<implementationId>rest-delete-impl</implementationId>
<implementationVersion>$implementation.version$</implementationVersion>
<definitionId>rest-delete</definitionId>
<definitionVersion>1.0.0</definitionVersion>
<definitionVersion>1.1.0</definitionVersion>
<implementationClassname>org.bonitasoft.connectors.rest.DeleteConnectorImpl</implementationClassname>
<hasSources>false</hasSources>
<description>The implementation of the REST Delete Connector.</description>

$Dependencies$

</implementation:connectorImplementation>
</implementation:connectorImplementation>
4 changes: 2 additions & 2 deletions src/main/resources/rest-get.impl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<implementationId>rest-get-impl</implementationId>
<implementationVersion>$implementation.version$</implementationVersion>
<definitionId>rest-get</definitionId>
<definitionVersion>1.0.0</definitionVersion>
<definitionVersion>1.1.0</definitionVersion>
<implementationClassname>org.bonitasoft.connectors.rest.GetConnectorImpl</implementationClassname>
<hasSources>false</hasSources>
<description>The implementation of the REST GET Connector.</description>

$Dependencies$

</implementation:connectorImplementation>
</implementation:connectorImplementation>
4 changes: 2 additions & 2 deletions src/main/resources/rest-post.impl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<implementationId>rest-post-impl</implementationId>
<implementationVersion>$implementation.version$</implementationVersion>
<definitionId>rest-post</definitionId>
<definitionVersion>1.0.0</definitionVersion>
<definitionVersion>1.1.0</definitionVersion>
<implementationClassname>org.bonitasoft.connectors.rest.PostConnectorImpl</implementationClassname>
<hasSources>false</hasSources>
<description>The implementation of the REST POST Connector.</description>

$Dependencies$

</implementation:connectorImplementation>
</implementation:connectorImplementation>
4 changes: 2 additions & 2 deletions src/main/resources/rest-put.impl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<implementationId>rest-put-impl</implementationId>
<implementationVersion>$implementation.version$</implementationVersion>
<definitionId>rest-put</definitionId>
<definitionVersion>1.0.0</definitionVersion>
<definitionVersion>1.1.0</definitionVersion>
<implementationClassname>org.bonitasoft.connectors.rest.PutConnectorImpl</implementationClassname>
<hasSources>false</hasSources>
<description>The implementation of the REST PUT Connector.</description>

$Dependencies$

</implementation:connectorImplementation>
</implementation:connectorImplementation>

0 comments on commit c6a5375

Please sign in to comment.