Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3070

Method getParameterMap in CryptedUrlWebRequestCodingStrategy.DecodedUrlRequest is broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.4.7
    • 1.5-M3
    • wicket
    • None

    Description

      The original Method in class org.apache.wicket.Request defines getParameterMap as

      public abstract Map<String, String[]> getParameterMap()

      In DecodedUrlRequest, the method just returns an untyped Map. This map, however, does not always conform to the specification:

      In the constructor, the following code can be found:

      // Add ALL of the params from the decoded 'x' param
      ValueMap params = new ValueMap();
      RequestUtils.decodeParameters(decodedParamReplacement, params);
      parameterMap.putAll(params);

      The method decodeParameters adds Strings (not String Arrays!) to the ValueMap, which are then just copied to the parameterMap.
      This is incorrect, it should add String Arrays instead.

      The method getParameter apparently knows about the problem, since it is checked whether the parameter values are Strings or String Arrays (via instanceof).

      External users of the method getParameterMap, however, cannot know about the problem and must expect that a correctly typed map is returned.

      Attachments

        Issue Links

          Activity

            People

              ivaynberg Igor Vaynberg
              mgottschalk Michael Gottschalk
              Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: