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/10/21 07:37:09 UTC

[GitHub] [apisix] spacewander commented on a change in pull request #5292: feat(proxy-rewrite): add method proxy

spacewander commented on a change in pull request #5292:
URL: https://github.com/apache/apisix/pull/5292#discussion_r733398484



##########
File path: apisix/plugins/proxy-rewrite.lua
##########
@@ -34,6 +34,13 @@ local schema = {
             maxLength   = 4096,
             pattern     = [[^\/.*]],
         },
+        method = {
+            description = "proxy route method",
+            type        = "string",
+            enum        = {"GET", "POST", "PUT", "HEAD", "DELETE", "OPTIONS",

Review comment:
       The enum can be calculated from the {GET = ngx.HTTP_GET, ...} map

##########
File path: apisix/plugins/proxy-rewrite.lua
##########
@@ -132,6 +139,51 @@ do
         core.table.insert(upstream_names, name)
     end
 
+    local switch = {

Review comment:
       We can use a `{GET = ngx.HTTP_GET, ...}` to dismiss repeating  `ngx.req.set_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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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