shelltea commented on issue #6066:
URL: https://github.com/apache/apisix/issues/6066#issuecomment-1009638712
```
function _M.rewrite(conf, ctx)
local headers = ngx.req.get_headers()
local uuid_val = get_request_id(conf.algorithm)
if not headers[conf.header_name] then
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
```
From the source code above, request-id plugin generated a request-id whether
or not the request contains one.I think if a request has a request-id means
request-id plugin don't have to generate one and response the same request-id
sent by the client.If request don't have a request-id means request-id plugin
need to generate and response the request-id generated by itself.So it not
dependent on an option.
--
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]