Uploaded image for project: 'apiman (API Management)'
  1. apiman (API Management)
  2. APIMAN-953

Duplicate GET parameters are lost

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 1.2.2.Final, 1.2.x
    • 1.2.1.Final
    • Gateway
    • None
    • Hide

      Call an api with ?bla=1&bla=2. Endpoint receives only ?bla=2 as query parameters.

      Show
      Call an api with ?bla=1&bla=2. Endpoint receives only ?bla=2 as query parameters.

    Description

      As described on

      http://stackoverflow.com/questions/1746507/authoritative-position-of-duplicate-http-get-query-keys

      there is no spec on whether duplicate http query parameters are allowed or not. One of the frameworks that allow use of multiple query parameter keys is Java EE:

      http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getParameterValues(java.lang.String)

      and also PHP uses this extensively (see first link).

      By saving query parameters in a Map<String, String> as Apiman does in ApiRequest, you loose the possibility to use multiple query parameters with the same key. With the current implementation only the last value for each key is saved.

      I wanted to fix this (using e.g. Map<String, List<String>>) and doing a pull request, but... I'm afraid that changing ApiRequest is a big no-no, as it probably breaks (custom) policy plugins such as APIMAN-813.

      However, fixing this issue now, in the early life of Apiman, is probably much better than trying to do this later...

      Thoughts?

      Attachments

        Activity

          People

            msavy_jira Marc Savy (Inactive)
            bramvonk Bram Vonk (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: