membphis commented on a change in pull request #3139:
URL: https://github.com/apache/apisix/pull/3139#discussion_r550227045



##########
File path: t/plugin/proxy-rewrite.t
##########
@@ -1249,3 +1249,41 @@ version: nginx_var_does_not_exist
 x-real-ip: 127.0.0.1
 --- no_error_log
 [error]
+
+
+
+=== TEST 42: set route(rewrite uri based on ctx.var)

Review comment:
       'arg_****': argument name in the request line
   
   nginx variable link: 
http://nginx.org/en/docs/http/ngx_http_core_module.html#var_arg_
   
   `$arg_new_uri`, it means to fetch the value from query string which name is 
`new_uri`.
   
   1.  the current request is `/test?new_uri=hello`, so the `$arg_new_uri` 
should equal `hello`
   2. `"uri": "/$arg_new_uri"` -> `"uri": "/hello"`
   3.  response body is 'hello world' if the request is `/hello`: 
https://github.com/apache/apisix/blob/master/t/lib/server.lua#L36
   4. check the response body 
   
   ```
   --- response_body 
   hello world
   ```




----------------------------------------------------------------
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:
[email protected]


Reply via email to