tree-sitter-http icon indicating copy to clipboard operation
tree-sitter-http copied to clipboard

[BUG] The '{' and '}' in the target_url are recognized as ERROR

Open askfiy opened this issue 1 year ago • 5 comments

The following request will not resolve successfully:

GET http://localhost:5000/index?userProperty={"name": "age"}

This kind of query_param with JSON information is also encountered in the actual development process, but it is not currently possible to parse

askfiy avatar Jul 15 '24 17:07 askfiy

I'm sorry but shouldn't it be properly encoded in the URL then?

GET http://localhost:5000/index?userProperty=%7B%22name%22%3A%20%22age%22%7D

I don't expect tree-sitter to parse invalid code

ccoVeille avatar Jul 15 '24 17:07 ccoVeille

Probably an issue caused by #32?

NTBBloodbath avatar Jul 15 '24 19:07 NTBBloodbath

You might be right, BTW.

When I saw the PR, I was surprised about the format.

ccoVeille avatar Jul 15 '24 20:07 ccoVeille

I think at some point the parser is going to need an additional handmade tree-sitter C scanner to avoid ambiguities and make everything much more flexible. If anyone has a better solution than that, you are welcome to make a PR or post it here

NTBBloodbath avatar Jul 15 '24 21:07 NTBBloodbath

Expect it to display nodes instead of ERRORs, and that there should be a specific program that handles URL encoding when the request is actually sent.

askfiy avatar Jul 16 '24 03:07 askfiy