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

Binary response data in tests and post-response #3477

Open
2 tasks done
koliyo opened this issue Nov 13, 2024 · 2 comments
Open
2 tasks done

Binary response data in tests and post-response #3477

koliyo opened this issue Nov 13, 2024 · 2 comments
Assignees
Labels
bug Something isn't working module-cli

Comments

@koliyo
Copy link

koliyo commented Nov 13, 2024

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

I see other issues referencing binary data in the bruno app, eg showing image in preview window, and downloading the response to file. But I am having issue with using binary data using bruno-cli in the response object. I have res.body which is of string type, and contains lots of UTF-8 Replacement Character instances.

Am I missing something, or is there no way of getting the raw binary data from the response in post-response or tests sections?

.bru file to reproduce the bug

No response

Screenshots/Live demo link

this is using the cli runner

@koliyo koliyo added the bug Something isn't working label Nov 13, 2024
@koliyo
Copy link
Author

koliyo commented Nov 14, 2024

It would be preferable if the cli and electron app use the same basic request processing. Right now there seem to be two implementations with different behavior.

 // usebruno/bruno/packages/bruno-electron/src/ipc/network/prepare-request.js
  let axiosRequest = {
    mode: request.body.mode,
    method: request.method,
    url,
    headers,
    pathParams: request?.params?.filter((param) => param.type === 'path'),
    responseType: 'arraybuffer'
  };

vs

  // usebruno/bruno/packages/bruno-cli/src/runner/prepare-request.js
  let axiosRequest = {
    method: request.method,
    url: request.url,
    headers: headers,
    pathParams: request?.params?.filter((param) => param.type === 'path')
  };

specifically the difference with responseType: 'arraybuffer'

@ganesh-bruno ganesh-bruno self-assigned this Nov 14, 2024
@ganesh-bruno
Copy link
Collaborator

Hey @koliyo,

Thanks for reporting this issue.

We’ve identified an inconsistency between the app and CLI.
We're working on it.

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

No branches or pull requests

3 participants