rest-nvim / rest.nvim

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

Digest auth does not work #483

Open svenXY opened 1 month ago

svenXY commented 1 month ago

Prerequisites

Neovim Version

NVIM v0.11.0-dev-700+gbcae8be91f

Operating system/version

MacOS 14.7

Actual behavior

GET https://httpbin.io/digest-auth/auth/user/pass
Authorization: Digest user:pass
Accept:application/json

response:

### foo#2
GET https://httpbin.io/digest-auth/auth/user/pass
HTTP/1.1 401 Unauthorized

# @_RES
{
  "status_code": 401,
  "error": "Unauthorized"
}

# @_END

Expected behavior

As this is the official httpbin.io endpoint for digest authentication, it should answer with 200 OK

Steps to reproduce

Use your own repro.lua and try with a .http file containing

GET https://httpbin.io/digest-auth/auth/user/pass
Authorization: Digest user:pass
Accept:application/json

Other information

This works for e.g. kulala

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 },
            },
        },
    },
})