jiangfucheng commented on code in PR #9778:
URL: https://github.com/apache/apisix/pull/9778#discussion_r1261925782


##########
apisix/plugins/consumer-restriction.lua:
##########
@@ -128,7 +128,13 @@ function _M.access(conf, ctx)
     local method = ngx.req.get_method()
 
     if not value then
-        return 401, { message = "Missing authentication or identity 
verification."}
+        local err_msg
+        if conf.type == "consumer_name" then
+            err_msg = "Missing authentication information in request."
+        else
+            err_msg = "Please ensure " .. conf.type .. " is present in request"
+        end

Review Comment:
   The request be rejected when `config.type` is `consumer_name` maybe cause by 
that the user authentication info not match any `consumer`, but not missing 
configuration of `consumer`. So, prompt user configuration is missing maybe not 
very suitable.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to