Florent Albert created OLINGO-1619:
--------------------------------------
Summary: [Regression] Batch part body containining binary data is
altered
Key: OLINGO-1619
URL: https://issues.apache.org/jira/browse/OLINGO-1619
Project: Olingo
Issue Type: Bug
Components: odata4-server
Affects Versions: (Java) V4 4.9.0
Reporter: Florent Albert
Use case: Batch request uploading a file (upsert media entity).
The batch request body will contain the serialized file as binary. For example:
{noformat}
--batch
Content-Type: multipart/mixed; boundary=changeset--changeset
Content-Type: application/http
Content-Transfer-Encoding:binary
Content-Id: 001
POST Documents HTTP/1.1
Content-Type: application/json
{
"Name":"Doc OData batch",
}
--changeset
Content-Type: application/http
Content-Transfer-Encoding:binary
Content-Id: 002
PUT $001/PrimaryContent HTTP/1.1
Content-Type: multipart/form-data; boundary=attachmentBoundary
Content-Encoding: binary
--attachmentBoundary
Content-Disposition: form-data;name="file1"; filename="test.docx"
Content-Type:
application/vnd.openxmlformats-officedocument.wordprocessingml.document
Content-Transfer-Encoding: binary
Content-Encoding: binary
<serialized file content here>
--attachmentBoundary--
--changeset--
--batch--{noformat}
In Olingo 4.9.0, when the batch request parts are deserialized by
FixedFormatDeserializer.parseBatchRequest(InputStream, String, BatchOptions),
the bodies of the resulting ODataRequest are different from the original
request sent.
This is a regression compared to Olingo 4.7.1, introduced by the following
commit:
[https://github.com/apache/olingo-odata4/commit/8bd229b40e30710525a056a4c395caf2565fe353].
It assumes a request body can only be text.
Using the 4.7.1 version of BatchLineReader fixed the issue.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)