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

Allow additional characters in Authorisation credentials

Open piersolenski opened this issue 1 year ago • 1 comments

I'm getting an error when trying to use = inside my Authorisation value.

For example, using;

Authorisation: Basic YmQ0NT02NTM4YWE5ND03MzJkMTdlN0RiNTdkOGFj0TAwZjhkZj0mYTp5Qzc4aDgmZW85R1A=

results in:

Error executing Lua callback: .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:114: attempt to index local 'req_node' (a nil value)
stack traceback:
	.../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:114: in function 'traverse_request'
	.../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:432: in function 'parse'
	...al/share/nvim/lazy/rest.nvim/lua/rest-nvim/functions.lua:61: in function 'exec'
	...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:44: in function 'impl'
	...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:182: in function <...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:165>

This seems related to https://github.com/rest-nvim/tree-sitter-http/pull/23 where it mentions = being disabled for URLs.

piersolenski avatar May 14 '24 01:05 piersolenski

I have the same problem when setting url as a header value. It seems like : and / are not allowed in value as well Example:

###

POST {{BASE_URL}}/registration/registration
Content-Type: application/json
Origin: https://example.com

{
  "hello": "world"
}

Error messages:


[rest.nvim] ERROR: The tree-sitter node at the range [4:8 - 16] has a syntax error and cannot be parsed
[rest.nvim] ERROR: The tree-sitter node at the range [4:8 - 16] has a syntax error and cannot be parsed
Error executing Lua callback: .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:114: attempt to index local 'req_node' (a nil value)
stack traceback:
        .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:114: in function 'traverse_request'
        .../share/nvim/lazy/rest.nvim/lua/rest-nvim/parser/init.lua:430: in function 'parse'
        ...al/share/nvim/lazy/rest.nvim/lua/rest-nvim/functions.lua:61: in function 'exec'
        ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:44: in function 'impl'
        ...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:182: in function <...cal/share/nvim/lazy/rest.nvim/lua/rest-nvim/commands.lua:165>

image

lephattan avatar May 28 '24 03:05 lephattan