Pass all querystring params to a redirect #2251
-
Is there a way to easily pass all querystring params to a redirect? I don't care what they are, the underlying service will take care of that I just need to pass them along but can't find a simple way to do it. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
From a security perspective, this is likely not a good idea, which is why Rocket makes it more difficult. The guide has a section on collecting the remaining query parameters: https://rocket.rs/v0.5-rc/guide/requests/#trailing-parameter. For your case, you likely want to just collect them into a HashMap, and write them to a url. However, if you would like to do any kind of validation against these before passing them on, I recommend creating a custom struct that implements |
Beta Was this translation helpful? Give feedback.
From a security perspective, this is likely not a good idea, which is why Rocket makes it more difficult.
The guide has a section on collecting the remaining query parameters: https://rocket.rs/v0.5-rc/guide/requests/#trailing-parameter. For your case, you likely want to just collect them into a HashMap, and write them to a url. However, if you would like to do any kind of validation against these before passing them on, I recommend creating a custom struct that implements
FromForm
with all of the fields to handle validation.