You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
"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.
The text was updated successfully, but these errors were encountered:
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. Ifproxy-rewrite
would have the same options for query params as for headers, we could configure it somethign like this: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.The text was updated successfully, but these errors were encountered: