Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$patch throwing an unknown error on Syncfusion Integration #783

Closed
alexamart opened this issue Jan 22, 2024 · 2 comments
Closed

$patch throwing an unknown error on Syncfusion Integration #783

alexamart opened this issue Jan 22, 2024 · 2 comments

Comments

@alexamart
Copy link

alexamart commented Jan 22, 2024

Hello,

I recently started using lodata integrated with EJ2 React - Syncfusion. Thanks for the package btw!

I've been implemating batch editing mode, which uses $batch - here it is a payload from a request:

--batch_c81e3155-cc0f-4b50-a619-a1ad50d37f46
Content-Type: multipart/mixed; boundary=changeset_bc197d01-816f-4f26-b65f-0c5f789ec7e7

--changeset_bc197d01-816f-4f26-b65f-0c5f789ec7e7
Content-Type: application/http
Content-Transfer-Encoding: binary

PATCH Areas(3) HTTP/1.1
Accept: application/json, text/javascript, /; q=0.01
Content-Id: 0
Content-Type: application/json; charset=utf-8

{"id":3,"general":"G"}

--changeset_bc197d01-816f-4f26-b65f-0c5f789ec7e7--
--batch_c81e3155-cc0f-4b50-a619-a1ad50d37f46--

Tracking the issue it came down to the use of \r\n to explode the $documents array in both lines linked bellow. Replacing \r\n with \n seems to fix it for me.

list($headers, $body) = array_map('trim', explode("\r\n\r\n", $document, 2));

foreach (explode("\r\n", $headers) as $header) {

@27pchrisl
Copy link
Contributor

Hi @alexamart, you're absolutely right, https://datatracker.ietf.org/doc/html/rfc7231#section-3.1.1.3 says the receiver must cope with either LF or CRLF being the line ending within the HTTP part of the message. I'm pushing a fix for that now...

@27pchrisl
Copy link
Contributor

That's released as https://github.com/flat3/lodata/releases/tag/v5.32.6 now, let me know if you have any more issues with the package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants