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

Error invoking remote method 'renderer:new-request': TypeError: Cannot read properties of null (reading 'includes'), when create form-urlencoded request from cURL #2288

Closed
2 tasks done
leonardoyhl opened this issue May 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@leonardoyhl
Copy link
Contributor

leonardoyhl commented May 11, 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

v1.17.0 on MacOS 10.15.7
When create a new form-urlencoded request from cURL, toast that Error invoking remote method 'renderer:new-request': TypeError: Cannot read properties of null (reading 'includes').

.bru file to reproduce the bug

No response

Screenshots/Live demo link

image

How to reproduce the problem?

Some parameter(s) in form-urlencoded type data missing =, like param2 parameter below.
e.g.:

curl 'https://example.com/api' \
  -H 'content-type: application/x-www-form-urlencoded' \
  --data-raw 'param1=1&param2'
@leonardoyhl leonardoyhl added the bug Something isn't working label May 11, 2024
@leonardoyhl
Copy link
Contributor Author

leonardoyhl commented May 11, 2024

Why?

  1. When parsing cURL command, app will use query-string to parse form-urlencoded type data string. If some parameter(s) in form-urlencoded type data string missing =, query-string will set value as null(Missing = should be null · sindresorhus/query-string).
image image

But it isn't a bug, just a feature following W3 specification(https://www.w3.org/TR/2012/WD-url-20120524/#collect-url-parameters).
image

  1. When convert json to bru type data in bruno-lang v2, will execute value.includes('\n');, then throw error.
image

@helloanoop
Copy link
Contributor

I have merged the PR @leonardoyhl !
Thanks for taking time to go through the W3 spec and make these fixes in Bruno!

This will get shipped in the release scheduled to go out today.

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