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

add support for response redirects #40

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

treywood
Copy link
Contributor

@treywood treywood commented Aug 27, 2024

grammar.js Outdated Show resolved Hide resolved
@boltlessengineer
Copy link
Contributor

This would be easier to implement now with recent updates in the grammar.
I’ll have a look if I can merge or rebase your commits later.
Merging PRs in tree-sitter parser is hard 😭

@treywood
Copy link
Contributor Author

treywood commented Aug 30, 2024

oof I actually think recent changes in main broke some thing outside of this PR. in particular, external bodies are broken with response handler scripts. specifically this test fails:

GET https://www.example.com

< ./user.json

> /handler.json

expected result:

(document
  (section
    (request
      method: (method)
      url: (target_url)
      body: (external_body
        path: (path))
      (res_handler_script
        (path))))

actual result:

(document
  (section
    (request
      method: (method)
      url: (target_url)
      body: (external_body
        path: (path))
      body: (raw_body) <-- unexpected
      (res_handler_script
        (path))))

it seems like additional content after an external body causes everything to just be parsed as a raw body

@treywood
Copy link
Contributor Author

@boltlessengineer I rebased on main, conflicts weren't too terrible :)

@treywood treywood force-pushed the redirect-response branch 3 times, most recently from 61e6a09 to 7c68e1c Compare September 1, 2024 03:48
@treywood
Copy link
Contributor Author

treywood commented Sep 5, 2024

@boltlessengineer bump :)

@boltlessengineer boltlessengineer merged commit 7c68e1c into rest-nvim:main Sep 5, 2024
1 check passed
@boltlessengineer
Copy link
Contributor

Merging now. Thank you for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants