tokers commented on a change in pull request #5292:
URL: https://github.com/apache/apisix/pull/5292#discussion_r733505023
##########
File path: apisix/plugins/proxy-rewrite.lua
##########
@@ -24,6 +24,19 @@ local re_sub = ngx.re.sub
local sub_str = string.sub
local str_find = core.string.find
+local switch_map = {GET = ngx.HTTP_GET, POST = ngx.HTTP_POST, PUT =
ngx.HTTP_PUT,
+ HEAD = ngx.HTTP_HEAD, DELETE = ngx.HTTP_DELETE,
+ OPTIONS = ngx.HTTP_OPTIONS, MKCOL = ngx.HTTP_MKCOL,
+ COPY = ngx.HTTP_COPY, MOVE = ngx.HTTP_MOVE,
+ PROPFIND = ngx.HTTP_PROPFIND, LOCK = ngx.HTTP_LOCK,
+ UNLOCK = ngx.HTTP_UNLOCK, PATCH = ngx.HTTP_PATCH,
+ TRACE = ngx.HTTP_TRACE,
+ }
+local schema_method_enum = {}
+for key, _ in pairs(switch_map) do
Review comment:
```suggestion
for key in pairs(switch_map) do
```
##########
File path: docs/en/latest/plugins/proxy-rewrite.md
##########
@@ -39,6 +39,7 @@ The `proxy-rewrite` is an upstream proxy information
rewriting plugin, which sup
| --------- | ------------- | ----------- | ------- | ----------------- |
------------------------------------------------------------ |
| scheme | string | optional | "http" | ["http", "https"] |
Upstream new `schema` forwarding protocol. This option is deprecated. It's
recommended to set the proxy `scheme` in the Upstream object's `scheme` field
instead.|
| uri | string | optional | | |
Upstream new `uri` forwarding address. Supports the use of [Nginx
variables](https://nginx.org/en/docs/http/ngx_http_core_module.html). Variables
must start with `$`, such as `$arg_name`. |
+| method | enum["GET", "POST", "PUT", "HEAD", "DELETE", "OPTIONS","MKCOL",
"COPY", "MOVE", "PROPFIND", "PROPFIND","LOCK", "UNLOCK", "PATCH", "TRACE"]
| optional | | | proxy route method to
this method。|
Review comment:
```suggestion
| method | enum["GET", "POST", "PUT", "HEAD", "DELETE",
"OPTIONS","MKCOL", "COPY", "MOVE", "PROPFIND", "PROPFIND","LOCK", "UNLOCK",
"PATCH", "TRACE"] | optional | | |
rewrite the HTTP 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]