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: [email protected]

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


Reply via email to