Derek Chen
Derek Chen

Reputation: 23

Can I add headers to httpCall method in envoy lua filter?

I try add more headers to httpCall method, but upstream can't received. example lua script: lua request_handle:httpCall( "service1", { [":method"] = "POST", [":path"] = "/", [":authority"] = "lua_cluster", [":authorization"] = "Basic 123456" }, "", 1000) Does it have 3 headers?

Upvotes: 1

Views: 1632

Answers (1)

Pubci
Pubci

Reputation: 4001

You can define any header as below.

request_handle:httpCall(
    "service1",
    {
     [":method"] = "POST",
     [":path"] = "/",
     [":authority"] = "lua_cluster",
     ["authorization"] = "Basic 123456",
     ["any-header"] = "header-value"
    },
    "",
    1000)

Upvotes: 1

Related Questions