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 2022/01/10 11:16:42 UTC
[GitHub] [apisix] shelltea commented on issue #6066: bug: request-id plugin overwrite X-Request-Id already present in the request
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org