Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honor parameters order when parsing query and form parameters #7599

Merged
merged 3 commits into from
Feb 16, 2022

Commits on Feb 15, 2022

  1. Honor parameters order when parsing query and form parameters

    When parsing the query or form parameters in Request, the values are stored in a MultiMap. This class extends HashMap which does not preserve the order of insertion so a request with parameters "first=1&second=2" might end up in a map where "second" will come first when iterating on the entry set. 
    
    The order is necessary in some case where the request is signed off the body and/or the query parameters. When the order is not preserved, it is impossible to reconstruct the original request sent, unless using the Request::getInputStream which consumes the stream and makes subsequent calls to Request::getParameters to don't return the form parameters which can be misleading. The same behavior applied to query parameters, by using Request::getQueryString, you get the correct order but Request::getParameters will not.
    
    Moreoever, if the application is behind a reverse proxy using Jetty that is proxying using Request::getParameters which consume the request InputStream, it will be completely impossible to reconstruct the original request.
    jebeaudet committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    c49bc24 View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2022

  1. Configuration menu
    Copy the full SHA
    4fe26bc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9ff06aa View commit details
    Browse the repository at this point in the history