shelltea commented on issue #6066:
URL: https://github.com/apache/apisix/issues/6066#issuecomment-1008773944


   I read the code:
   
   
https://github.com/apache/apisix/blob/master/apisix/plugins/request-id.lua#L212-L222
   
   I think it should change to this:
   
   ```
   function _M.rewrite(conf, ctx)
       local uuid_val = core.request.header(ctx, conf.header_name)
       if uuid_val == nil then
           uuid_val = get_request_id(conf.algorithm)
           core.request.set_header(ctx, conf.header_name, uuid_val)
       end
   
       if conf.include_in_response then
           ctx["request-id-" .. conf.header_name] = uuid_val
       end
   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