Baoyuantop commented on code in PR #12837:
URL: https://github.com/apache/apisix/pull/12837#discussion_r2719426988
##########
apisix/plugins/request-id.lua:
##########
@@ -102,7 +102,7 @@ end
function _M.rewrite(conf, ctx)
local headers = ngx.req.get_headers()
local uuid_val
- if not headers[conf.header_name] then
+ if not headers[conf.header_name] or headers[conf.header_name] == "" then
Review Comment:
We can switch to a more readable style:
```
local header_req_id = headers[conf.header_name]
if not header_req_id or header_req_id == "" then
...
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]