markokocic opened a new issue, #11237:
URL: https://github.com/apache/apisix/issues/11237
### Description
`proxy-rewrite` plugin has a possibility to add / remove / set headers to
the request. It would be nice if it were possible to add / remove / set url
query parameters.
For example, let's say we get a request with the following uri:
`/path?param1=1¶m2=this¶m3=that` and want to overwrite param1, remove
param2, and add param4 before sending the request to the upstream. If
`proxy-rewrite` would have the same options for query params as for headers, we
could configure it somethign like this:
```json
"proxy-rewrite": {
"uri": "/test/home.html",
"host": "iresty.com",
"query-params": {
"set": {
"param1": "etwas"
},
"add": {
"param4": "(id=32&name=\"test*\")&age<32",
"param4" : "it's valid to have more params with the same name"
},
"remove":[
"param2"
]
}
```
Plugin should take care that complete search sting is properly escaped and
encoded. This would come very handy when dealing with ODATA services on the
backend that use query-params intensively.
Alternative: theoretically it is possible to manipulate the whole uri,
including the search string, using `regex_uri`, but in the case of multiple
parameters that regex can quickly grow very wild and unreliable.
--
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]