Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: header rewrite empty #35

Merged
merged 3 commits into from
Aug 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions src/apisix/t/bk-stage-header-rewrite.t
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,42 @@ uri: /uri/plugin_proxy_rewrite
host: localhost
x-api-engine: APISIX
x-real-ip: 127.0.0.1

=== TEST 13: remove header set empty
--- config
location /t {
content_by_lua_block {
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/routes/1',
ngx.HTTP_PUT,
[[{
"plugins": {
"bk-proxy-rewrite": {
"uri": "/uri/plugin_proxy_rewrite"
},
"bk-stage-header-rewrite": {
"add": {},
"set": {},
"remove": ["X-Api-Test"]
}
},
"upstream": {
"nodes": {
"127.0.0.1:1980": 1
},
"type": "roundrobin"
},
"uri": "/hello"
}]]
)

if code >= 300 then
ngx.status = code
end
ngx.say(body)
}
}
--- request
GET /t
--- response_body
passed
zhu327 marked this conversation as resolved.
Show resolved Hide resolved