You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "markokocic (via GitHub)" <gi...@apache.org> on 2024/05/07 15:48:39 UTC

[I] feat: Add the possibility to manipulate query parameters / search string using proxy-rewrite plugin [apisix]

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&param2=this&param3=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&lt;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: notifications-unsubscribe@apisix.apache.org.apache.org

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


Re: [I] feat: Add the possibility to manipulate query parameters / search string using proxy-rewrite plugin [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #11237: feat: Add the possibility to manipulate query parameters / search string using proxy-rewrite plugin
URL: https://github.com/apache/apisix/issues/11237


-- 
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


Re: [I] feat: Add the possibility to manipulate query parameters / search string using proxy-rewrite plugin [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #11237:
URL: https://github.com/apache/apisix/issues/11237#issuecomment-3714048440

   This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.


-- 
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


Re: [I] feat: Add the possibility to manipulate query parameters / search string using proxy-rewrite plugin [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #11237:
URL: https://github.com/apache/apisix/issues/11237#issuecomment-3772049851

   This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.


-- 
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


Re: [I] feat: Add the possibility to manipulate query parameters / search string using proxy-rewrite plugin [apisix]

Posted by "rohitkrishna-marneni (via GitHub)" <gi...@apache.org>.
rohitkrishna-marneni commented on issue #11237:
URL: https://github.com/apache/apisix/issues/11237#issuecomment-2603079133

   Is there any other workaround for this? Or has some written a lua plugin?


-- 
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


Re: [I] feat: Add the possibility to manipulate query parameters / search string using proxy-rewrite plugin [apisix]

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on issue #11237:
URL: https://github.com/apache/apisix/issues/11237#issuecomment-2119707669

   Just adding that the plugin currently can add URI parameters by rewriting the whole URI. See example here: https://docs.api7.ai/hub/proxy-rewrite#add-url-parameters
   
   It does not yet support the capability to rewrite each URI parameter individually as @markokocic mentioned.


-- 
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