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/07/01 14:07:33 UTC

[GitHub] [apisix] slene commented on issue #4516: bug: Generates lot of useless logs when cookie not found

slene commented on issue #4516:
URL: https://github.com/apache/apisix/issues/4516#issuecomment-872277821


   @spacewander  How about this ?
   
   ```diff
   @@ -111,7 +111,11 @@ end
    do
        local var_methods = {
            method = ngx.req.get_method,
   -        cookie = function () return ck:new() end
   +        cookie = function ()
   +            if ngx.var.http_cookie then
   +                return ck:new()
   +            end
   +        end
        }
   
        local ngx_var_names = {
   @@ -153,7 +157,7 @@ do
                    if cookie then
                        local err
                        val, err = cookie:get(sub_str(key, 8))
   -                    if not val then
   +                    if err then
                            log.warn("failed to fetch cookie value by key: ",
                                     key, " error: ", err)
                        end
   ```


-- 
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