Repository: camel Updated Branches: refs/heads/master d62cbe8ec -> 29b862b0c
CAMEL-9012: Olingo2's batch process generates the invalid request Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/29b862b0 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/29b862b0 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/29b862b0 Branch: refs/heads/master Commit: 29b862b0ca4a3d1f457b20ba7890553c8edb2c96 Parents: d62cbe8 Author: Akitoshi Yoshida <a...@apache.org> Authored: Fri Jul 24 16:46:42 2015 +0200 Committer: Akitoshi Yoshida <a...@apache.org> Committed: Fri Jul 24 16:47:29 2015 +0200 ---------------------------------------------------------------------- .../camel/component/olingo2/api/impl/Olingo2AppImpl.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/29b862b0/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/Olingo2AppImpl.java ---------------------------------------------------------------------- diff --git a/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/Olingo2AppImpl.java b/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/Olingo2AppImpl.java index b4e7bb7..7b82e69 100644 --- a/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/Olingo2AppImpl.java +++ b/components/camel-olingo2/camel-olingo2-api/src/main/java/org/apache/camel/component/olingo2/api/impl/Olingo2AppImpl.java @@ -665,13 +665,7 @@ public final class Olingo2AppImpl implements Olingo2App { final String boundary = BOUNDARY_PREFIX + UUID.randomUUID(); InputStream batchRequest = EntityProvider.writeBatchRequest(parts, boundary); - // add two blank lines before all --batch boundaries - // otherwise Olingo2 EntityProvider parser barfs in the server!!! - final byte[] bytes = EntityProvider.readBinary(batchRequest); - final String batchRequestBody = new String(bytes, Consts.UTF_8); - batchRequest = new ByteArrayInputStream(batchRequestBody.replaceAll( - "--(batch_)", "\r\n\r\n--$1").getBytes(Consts.UTF_8)); - + // two blank lines are already added. No need to add extra blank lines final String contentHeader = BATCH_CONTENT_TYPE + BOUNDARY_PARAMETER + boundary; return ODataResponse.entity(batchRequest).contentHeader(contentHeader).build(); }