rest.nvim icon indicating copy to clipboard operation
rest.nvim copied to clipboard

Only first header value gets used and all other headers are thrown away on nightly Neovim

Open mawkler opened this issue 1 year ago • 1 comments

Prerequisites

  • [X] I am using the latest stable release of Neovim
  • [X] I am using the latest version of the plugin

Neovim Version

NVIM v0.11.0-dev-946+g25665b365

Operating system/version

Manjaro Linux x86_64

Actual behavior

Only the first header value is included in requests.

Expected behavior

All header values are included in the request. Expected output of :Rest curl yank:

curl -sL 'https://httpbin.org/headers' '-X' 'GET' '-H' 'Foo: foo' '-H' 'Bar: bar' '-H' 'Baz: baz' '-b' 'testcookie=foo'

Steps to reproduce

  1. Use the following request:

    GET https://httpbin.org/headers
    Foo: foo
    Bar: bar
    Baz: baz
    
  2. :Rest curl yank gives the output (notice how there's only one '-H'):

    curl -sL 'https://httpbin.org/headers' '-X' 'GET' '-H' 'Foo: foo' '-b' 'testcookie=foo'
    

Other information

I clicked "I am using the latest stable release of Neovim" because I had to to create this issue, even though I'm on nightly. I figured this could potentially be a breaking change in Neovim that rest.nvim might have to adapt to.

Repro (lazy.nvim)

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
    spec = {
        "rest-nvim/rest.nvim",
        {
            "nvim-treesitter/nvim-treesitter",
            build = ":TSUpdate",
            main = "nvim-treesitter.configs",
            opts = {
                ensure_installed = { "http" },
                sync_install = false,
                highlight = { enable = true },
                indent = { enable = true },
            },
        },
    },
})

mawkler avatar Oct 11 '24 08:10 mawkler

Thank you for your report! This seems to be a nightly bug. I opened an issue in neovim repo.

boltlessengineer avatar Oct 13 '24 06:10 boltlessengineer

Upstream issue seems to be fixed now: https://github.com/neovim/neovim/issues/30792

If anyone is seeing this bug, update to latest nightly or stay on stable release (v0.10)

boltlessengineer avatar Feb 23 '25 08:02 boltlessengineer