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 2021/05/27 02:23:41 UTC

[GitHub] [apisix] Marco-Zheng opened a new issue #4318: request help: Set reuquest var in header, but i don't get param from ctx.var

Marco-Zheng opened a new issue #4318:
URL: https://github.com/apache/apisix/issues/4318


   ### Issue description
   I see that in the traffic-split of the official case of Apisix, ctx.var is the value from the request header, but when I put the parameter in the header when I requested it, I didn't get the value ?
   ![image](https://user-images.githubusercontent.com/52538259/119756074-91e5cc80-bed5-11eb-9136-5a4cd41bf1cf.png)
   ![image](https://user-images.githubusercontent.com/52538259/119756078-94482680-bed5-11eb-841b-acb2df6b1407.png)
   
   ### Environment
   * apisix version (cmd: `apisix version`): 2.4
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Firstsawyou commented on issue #4318: request help: Set reuquest var in header, but i don't get param from ctx.var

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on issue #4318:
URL: https://github.com/apache/apisix/issues/4318#issuecomment-849308722


   The request header information will not be stored in ctx.var unless we store it in advance. The request header is obtained by using nginx's `$http_PARAMETER` method.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander closed issue #4318: request help: Set request var in header, but i don't get param from ctx.var

Posted by GitBox <gi...@apache.org>.
spacewander closed issue #4318:
URL: https://github.com/apache/apisix/issues/4318


   


-- 
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] tokers commented on issue #4318: request help: Set reuquest var in header, but i don't get param from ctx.var

Posted by GitBox <gi...@apache.org>.
tokers commented on issue #4318:
URL: https://github.com/apache/apisix/issues/4318#issuecomment-849268666


   @Firstsawyou Please take a look when you have time.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] starsz edited a comment on issue #4318: request help: Set reuquest var in header, but i don't get param from ctx.var

Posted by GitBox <gi...@apache.org>.
starsz edited a comment on issue #4318:
URL: https://github.com/apache/apisix/issues/4318#issuecomment-850307543


   > The request header information will not be stored in ctx.var unless we store it in advance. The request header is obtained by using nginx's `$http_PARAMETER` method.
   
   
   Hi @Marco-Zheng, here we override the index function.
   You can refer to: 
   
   https://github.com/apache/apisix/blob/9a40fd7cb497974f9d7bd75f128eed5dd238cdc6/apisix/core/ctx.lua#L136-L162


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #4318: request help: Set request var in header, but i don't get param from ctx.var

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #4318:
URL: https://github.com/apache/apisix/issues/4318#issuecomment-884181882


   Closed as lack of response.


-- 
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 issue #4318: request help: Set reuquest var in header, but i don't get param from ctx.var

Posted by GitBox <gi...@apache.org>.
starsz commented on issue #4318:
URL: https://github.com/apache/apisix/issues/4318#issuecomment-850307543


   > The request header information will not be stored in ctx.var unless we store it in advance. The request header is obtained by using nginx's `$http_PARAMETER` method.
   
   Not really true. Here we override the index function.
   Hi @Marco-Zheng, you can refer to: 
   
   https://github.com/apache/apisix/blob/9a40fd7cb497974f9d7bd75f128eed5dd238cdc6/apisix/core/ctx.lua#L136-L162


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #4318: request help: Set reuquest var in header, but i don't get param from ctx.var

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #4318:
URL: https://github.com/apache/apisix/issues/4318#issuecomment-849386162


   like @Firstsawyou said, with `ctx.var` you can't just rely on dynamic debug to see what values are in it, there is even a portion of c data in this.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org