You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/11/04 06:46:41 UTC

[GitHub] [apisix] leslie-tsang commented on a change in pull request #5419: fix: add handler for invalid basic auth header values

leslie-tsang commented on a change in pull request #5419:
URL: https://github.com/apache/apisix/pull/5419#discussion_r742572618



##########
File path: apisix/plugins/basic-auth.lua
##########
@@ -80,12 +80,19 @@ local function extract_auth_header(authorization)
             return nil, err
         end
 
+        if not m then
+            return nil, "Invalid authorization header format"
+        end
+
         local decoded = ngx.decode_base64(m[1])

Review comment:
       @spacewander seems decode_base64 always return a `ffi_string`
   https://github.com/openresty/lua-resty-core/blob/985eb5b323468effaa66deb5cbd4f800b99834cf/lib/resty/core/base64.lua#L60




-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org