Skip to content

Commit

Permalink
fix: Basic auth plugin should run in rewrite phase. (#2905)
Browse files Browse the repository at this point in the history
  • Loading branch information
jenskeiner authored Dec 1, 2020
1 parent ddfeb5d commit c140d0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apisix/plugins/basic-auth.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ do
end
end

function _M.access(conf, ctx)
function _M.rewrite(conf, ctx)
core.log.info("plugin access phase, conf: ", core.json.delay_encode(conf))

-- 1. extract authorization from header
Expand Down
2 changes: 2 additions & 0 deletions t/plugin/basic-auth.t
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ Authorization: Basic Zm9vOmJhcg==
hello world
--- no_error_log
[error]
--- error_log
find consumer foo



Expand Down

0 comments on commit c140d0e

Please sign in to comment.