Skip to content

Commit

Permalink
fix: v3_adapter.filter(data) causes some API response body empty when…
Browse files Browse the repository at this point in the history
… disabling v3 admin API (#8349)

Fixes #8346
  • Loading branch information
zlhgo authored Nov 18, 2022
1 parent 2f4a4db commit ae400b9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apisix/admin/v3_adapter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ end

function _M.filter(body)
if not enable_v3() then
return
return body
end

local args = request.get_uri_args()
Expand Down
17 changes: 17 additions & 0 deletions t/admin/api.t
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,20 @@ deployment:
enable_admin_cors: false
--- response_headers
Access-Control-Allow-Origin:
=== TEST 8: Compatibility for admin API (v2)
--- yaml_config
deployment:
role: traditional
role_traditional:
config_provider: etcd
admin:
admin_key: ~
admin_api_version: default
--- more_headers
X-API-KEY: edd1c9f034335f136f87ad84b625c8f1
--- response_headers
X-API-VERSION: v2
--- response_body_like: "\\/apisix\\/routes"

0 comments on commit ae400b9

Please sign in to comment.