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

Allow additional characters in Authorisation credentials #30

Closed
piersolenski opened this issue May 14, 2024 · 1 comment · Fixed by #38
Closed

Allow additional characters in Authorisation credentials #30

piersolenski opened this issue May 14, 2024 · 1 comment · Fixed by #38

Comments

@piersolenski
Copy link

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 #23 where it mentions = being disabled for URLs.

@lephattan
Copy link

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

boltlessengineer added a commit to boltlessengineer/tree-sitter-http that referenced this issue Jul 25, 2024
refactor the parser following more well-known [spec]. This resolves most
opened issues

changelog
- change bunch of node names and fields
- make request method optionable
- disallow whitespace in front of request
- multi-line target_url by indented lines
- require blank line between URL+header & body
- require `###` separator between each requests
- don't parse url scheme and stuffs (not worth it)
- support `//` comment
- allows whitespace in form-data

fixed rest-nvim#18
fixed rest-nvim#19
fixed rest-nvim#29
fixed rest-nvim#30
fixed rest-nvim#31
fixed rest-nvim#33
fixed rest-nvim#35

[spec]: https://www.jetbrains.com/help/idea/exploring-http-syntax.html
boltlessengineer added a commit to boltlessengineer/tree-sitter-http that referenced this issue Jul 25, 2024
refactor the parser following more well-known [spec]. This resolves most
opened issues

changelog
- change bunch of node names and fields
- make request method optionable
- disallow whitespace in front of request
- multi-line target_url by indented lines
- require blank line between URL+header & body
- require `###` separator between each requests
- don't parse url scheme and stuffs (not worth it)
- support `//` comment
- allows whitespace in form-data

fixed rest-nvim#18
fixed rest-nvim#19
fixed rest-nvim#29
fixed rest-nvim#30
fixed rest-nvim#31
fixed rest-nvim#33
fixed rest-nvim#35

[spec]: https://www.jetbrains.com/help/idea/exploring-http-syntax.html
boltlessengineer added a commit to boltlessengineer/tree-sitter-http that referenced this issue Aug 20, 2024
refactor the parser following more well-known [spec]. This resolves most
opened issues

changelog
- change bunch of node names and fields
- make request method optionable
- disallow whitespace in front of request
- multi-line target_url by indented lines
- require blank line between URL+header & body
- require `###` separator between each requests
- don't parse url scheme and stuffs (not worth it)
- support `//` comment
- allows whitespace in form-data

fixed rest-nvim#18
fixed rest-nvim#19
fixed rest-nvim#29
fixed rest-nvim#30
fixed rest-nvim#31
fixed rest-nvim#33
fixed rest-nvim#35

[spec]: https://www.jetbrains.com/help/idea/exploring-http-syntax.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants