rest-nvim / rest.nvim

A fast Neovim http client written in Lua
GNU General Public License v3.0
1.55k stars 142 forks source link

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

Open mawkler opened 6 days ago

mawkler commented 6 days ago

Prerequisites

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 },
            },
        },
    },
})
boltlessengineer commented 4 days ago

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