This is an automated email from the ASF dual-hosted git repository.

shuyangw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 3ba24c4  test: show how to bypass the ctx.var cache (#3914)
3ba24c4 is described below

commit 3ba24c47d45bf47bf81abf93394bc45bacf0eb6c
Author: 罗泽轩 <[email protected]>
AuthorDate: Mon Mar 29 08:53:32 2021 +0800

    test: show how to bypass the ctx.var cache (#3914)
    
    Signed-off-by: spacewander <[email protected]>
---
 t/plugin/proxy-rewrite2.t | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/t/plugin/proxy-rewrite2.t b/t/plugin/proxy-rewrite2.t
index b1a4461..5045792 100644
--- a/t/plugin/proxy-rewrite2.t
+++ b/t/plugin/proxy-rewrite2.t
@@ -70,3 +70,37 @@ upstreams:
 --- error_code: 503
 --- error_log
 Can't detect upstream's scheme
+
+
+
+=== TEST 2: access $upstream_uri before proxy-rewrite
+--- apisix_yaml
+global_rules:
+  -
+    id: 1
+    plugins:
+      serverless-pre-function:
+        phase: rewrite
+        functions:
+            - "return function() ngx.log(ngx.WARN, 'serverless [', 
ngx.var.upstream_uri, ']') end"
+routes:
+  -
+    id: 1
+    uri: /hello
+    plugins:
+        proxy-rewrite:
+            uri: "/plugin_proxy_rewrite"
+    upstream_id: 1
+upstreams:
+  -
+    id: 1
+    nodes:
+        "127.0.0.1:1980": 1
+    type: roundrobin
+#END
+--- error_log
+serverless []
+--- response_body
+uri: /plugin_proxy_rewrite
+host: localhost
+scheme: http

Reply via email to