Skip to content

Commit cca2553

Browse files
committed
fix(parser): parse headers after script processing
1 parent fd44862 commit cca2553

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lua/kulala/parser/request.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,9 @@ local function process_pre_request_scripts(request)
315315

316316
Scripts.run("pre_request", request)
317317

318-
-- INFO: now replace the variables in the URL, headers and body again,
319-
-- because user scripts could have changed them,
320-
-- but this time also warn the user if a variable is not found
318+
-- Process variables and headers again in case pre-request scripts modified them
321319
process_variables(request)
320+
set_headers(request, request.environment)
322321

323322
local skip = request.environment["__skip_request"] == "true"
324323
request.environment["__skip_request"] = nil

tests/minit.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ require("lazy.minit").busted({
2525
task = false, -- show task start/end
2626
colors = true, -- use ansi colors
2727
},
28-
{ dir = vim.uv.cwd() }, -- Current working directory for tests
29-
{ "nvim-treesitter/nvim-treesitter" },
28+
spec = {
29+
{ dir = vim.uv.cwd() }, -- Current working directory for tests
30+
{ "nvim-treesitter/nvim-treesitter", branch = "master" },
31+
},
3032
}, { install = { missing = true } })

0 commit comments

Comments
 (0)