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

Bruno uses LF instead of CRLF in multipart batch requests on macOS, causing failures in OData APIs (CAP-based services #3907

Open
2 tasks done
jankrieg opened this issue Jan 29, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jankrieg
Copy link

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

When sending an OData batch request (multipart/mixed) from Bruno on macOS, the request uses LF (\n) instead of CRLF (\r\n) for line endings. This causes batch requests to fail when sent to an SAP CAP (Cloud Application Programming) service, which strictly requires CRLF line endings.

A typically payload for such a request looks like this:

--batch_id-12345
Content-Type: application/http
Content-Transfer-Encoding: binary

POST myEntity HTTP/1.1
Content-Type: application/json

{
"Key1": "V12345678901234567890",
"Key2": "P0000000000000000001",
"Data1": "Test Vehicle",
"dbEntryCreatedOn": "2025-01-29T12:34:56.000Z"
}

--batch_id-12345--

If the line break after each line is LF, the request fails. This does not happen on windows machines but unfortunately MacOS uses LF instead of CRLF. Could you add a feature like in VS Code where you can tell VS Code to use CRLF instead of LF.

Thanks,
Jan

P.S.: The issue is also described here: https://community.sap.com/t5/technology-q-a/cap-batch-request-for-odata-apis/qaq-p/12158399

.bru file to reproduce the bug

If I use the body as in the screenshot I get an error.
When I create a text file with exactly the same content with VS Code set to CRLF mode and use this file:

curl -X POST "$API_URL"
-H "Authorization: Bearer $TOKEN"
-H "Content-Type: multipart/mixed; boundary=batch_id-12345"
-H "Accept: application/json"
--data-binary "@$BATCH_FILE"

everything works. If I save the file in LF mode also curl fails.

Screenshots/Live demo link

Image
@jankrieg jankrieg added the bug Something isn't working label Jan 29, 2025
@sreelakshmi-bruno sreelakshmi-bruno self-assigned this Feb 3, 2025
@sreelakshmi-bruno
Copy link
Collaborator

Hi, we're looking into this. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants