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

[Bug] Missing url prefix results in Cannot read properties of undefined #387

Closed
mppadding opened this issue Oct 5, 2023 · 9 comments
Closed

Comments

@mppadding
Copy link

When trying to send a request to localhost:8000 without using a prefix such as http:// or https:// the following error pops up.

Error invoking remote method 'send-http-request': TypeError: Cannot read properties of undefined (reading 'headers')
image

It would be logical if bruno either:

  • implicit prefix with http://
  • implicit prefix with https://
  • explicit message about the missing prefix

When generating code from this request I also get the following as raw HTTP request:

GET null HTTP/1.1
Content-Type: application/json
Host: 0.0.31.64
@benlloyd50
Copy link

+1 to a configurable default like http:// or https:// for a collection and a explicit error message for this case. very easy to get tripped up on this when first using the app.

@eloo-abi
Copy link

eloo-abi commented Oct 6, 2023

hi,
i see the same error for different problems with a requests..
i guess right now the Cannot read properties of undefined is only a symptom of a different root cause.
For me it looks like the parsing of the bru file is not working because of some missing properties or wrong properties which results in undefined object.

Maybe it would be better to check if the file could be parsed anyway and check if the object is not undefined before trying to read the props.
And of course raise the parse error with a proper reason what causes the parsing to fail

@btecu
Copy link

btecu commented Oct 6, 2023

Running into the same, except I do have https:// but I have a custom port and a special domain - looks like the error is not specific at all and is always displayed for any issue.

@helloanoop
Copy link
Contributor

Cannot read properties of undefined is a bug that got recently introduced.

Will be sending out a patch release later today that fixes this.

Also @btecu If your request might be failing due to a custom ssl. You can disable ssl and try by setting it in the preferences.
To access preferences, click on the gear icon in the bottom left of the screen.

image

@btecu
Copy link

btecu commented Oct 6, 2023

Thanks, that fixed it in my case. Have I gotten an error about SSL I could have figure it out.

@edbrannin
Copy link
Contributor

edbrannin commented Oct 7, 2023

Context for other people looking for this bug:

It seems like this happens when the request fails at a low level, like the target host not being found.

For example, I can GET https://google.com just fine, but I get this error when I GET https://google.commmm

@helloanoop
Copy link
Contributor

Have published a patch fix for this inv0.21.1

Hoping that this has also taken care of the issue @edbrannin mentioned

@eloo-abi
Copy link

eloo-abi commented Oct 9, 2023

@helloanoop thanks for the fix.

can confirm in my case the generic error is gone..
but now i see a different one :P but thats another topic 👍

@anusree-bruno
Copy link
Collaborator

Closing this issue as this has been fixed

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

No branches or pull requests

7 participants