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/20 08:57:56 UTC

[GitHub] [apisix] yujintang opened a new pull request #6160: fix(plugins-request-id): if the header_name is already present in the…

yujintang opened a new pull request #6160:
URL: https://github.com/apache/apisix/pull/6160


   if the header_name is already present in the request uuid_val include_in_response should keep source
   
   ### What this PR does / why we need it:
   in request-id plugin, when header_name is already present in the request, we should keep source id 
   
   ### Pre-submission checklist:
   no


-- 
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



[GitHub] [apisix] spacewander merged pull request #6160: fix(request-id): if the header_name is already present in the…

Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #6160:
URL: https://github.com/apache/apisix/pull/6160


   


-- 
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



[GitHub] [apisix] starsz commented on a change in pull request #6160: fix(plugins-request-id): if the header_name is already present in the…

Posted by GitBox <gi...@apache.org>.
starsz commented on a change in pull request #6160:
URL: https://github.com/apache/apisix/pull/6160#discussion_r790785931



##########
File path: apisix/plugins/request-id.lua
##########
@@ -214,6 +214,8 @@ function _M.rewrite(conf, ctx)
     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)
+    else
+        uuid_val = headers[conf.header_name]

Review comment:
       I think we can avoid calling get_request_id if the id exists.




-- 
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



[GitHub] [apisix] tzssangglass commented on pull request #6160: fix(plugins-request-id): if the header_name is already present in the…

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on pull request #6160:
URL: https://github.com/apache/apisix/pull/6160#issuecomment-1017539571


   LGTM


-- 
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



[GitHub] [apisix] haoyang1994 commented on a change in pull request #6160: fix(request-id): if the header_name is already present in the…

Posted by GitBox <gi...@apache.org>.
haoyang1994 commented on a change in pull request #6160:
URL: https://github.com/apache/apisix/pull/6160#discussion_r813679221



##########
File path: apisix/plugins/request-id.lua
##########
@@ -214,6 +214,8 @@ function _M.rewrite(conf, ctx)
     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)
+    else
+        uuid_val = headers[conf.header_name]

Review comment:
       This change should be submitted with an switch. In my situation, i can't trust the request id I received and must rewrite it with a new uuid.




-- 
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