Firstsawyou commented on a change in pull request #3556:
URL: https://github.com/apache/apisix/pull/3556#discussion_r578982166



##########
File path: t/plugin/proxy-rewrite.t
##########
@@ -1370,3 +1370,52 @@ host: test.com:6443
 x-real-ip: 127.0.0.1
 --- no_error_log
 [error]
+
+
+
+=== TEST 47: set route(rewrite HTTP method)
+--- config
+    location /t {
+        content_by_lua_block {
+            local t = require("lib.test_admin").test
+            local code, body = t('/apisix/admin/routes/1',
+                 ngx.HTTP_PUT,
+                 [[{
+                        "methods": ["GET"],
+                        "plugins": {
+                            "proxy-rewrite": {
+                                "method": "POST"
+                            }
+                        },
+                        "upstream": {
+                            "nodes": {
+                                "127.0.0.1:1980": 1
+                            },
+                            "type": "roundrobin"
+                        },
+                        "uri": "/hello"
+                }]]
+                )
+
+            if code >= 300 then
+                ngx.status = code
+            end
+            ngx.say(body)
+        }
+    }
+--- request
+GET /t
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 48: rewrite HTTP method
+--- request
+GET /hello
+--- response_body
+method: POST

Review comment:
       You should use `error_log eval` to check the printed log information.
   
   Similar to this: 
   ```
   --- error_log eval
   qr/changed HTTP method from ......./
   ```




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