Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x 17e120092 -> e07b08a01


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/e07b08a0
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e07b08a0
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e07b08a0

Branch: refs/heads/camel-2.15.x
Commit: e07b08a01e727629b8dc55fc759154b446612a0d
Parents: 17e1200
Author: Akitoshi Yoshida <a...@apache.org>
Authored: Fri Jul 24 16:46:42 2015 +0200
Committer: Aki Yoshida <elak...@gmail.com>
Committed: Fri Jul 24 18:52:10 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/e07b08a0/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();
     }

Reply via email to