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/02/15 04:36:12 UTC
[GitHub] [apisix] liangliang4ward commented on a change in pull request #6300: fix: when proxy-rewrite plugin's conf.headers are missing,conf.method can make effect
liangliang4ward commented on a change in pull request #6300:
URL: https://github.com/apache/apisix/pull/6300#discussion_r806439577
##########
File path: t/plugin/proxy-rewrite3.t
##########
@@ -151,3 +151,57 @@ plugin_proxy_rewrite get method: GET
--- response_body
property "method" validation failed: matches none of the enum values
done
+
+
+
+=== TEST 6: set route(rewrite method with headers)
+--- 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": {
+ "uri": "/uri/plugin_proxy_rewrite",
+ "method": "POST",
+ "scheme": "http",
+ "host": "apisix.iresty.com",
+ "headers":{
+ "x-api-version":"v1"
+ }
+ }
+ },
+ "upstream": {
+ "nodes": {
+ "127.0.0.1:1980": 1
+ },
+ "type": "roundrobin"
+ },
+ "uri": "/hello"
+ }]]
+ )
+
+ if code >= 300 then
+ ngx.status = code
+ end
+ ngx.say(body)
+ }
+ }
+--- response_body
+passed
+
+
+
+=== TEST 7: hit route(with out header)
Review comment:
modified
--
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