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

url-escaping is not undone for requestcodingstrategy

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.4.6
    • None
    • None

    Description

      When a resourceUrl with special characters is invoked by Wicket. Wicket does not read it correctly.

      In the test-application I add two images.
      The first one I call with a special character in the name of the resourceReference and it doesn't work (ERROR - shared resource org.apache.wicket.Application/withSpecialChar%DB%A9 not found).
      The second one is the same image but with no special character in the call and that works fine.

      Please also review WicketFilter, the method:getLastModified(final HttpServletRequest servletRequest). This need also be fixed.

      I resolved the problem by changing the resourceReferenceKey in WicketFilter, getLastModified to:
      final String resourceReferenceKey = WicketURLDecoder.PATH_INSTANCE.decode(pathInfo.substring(WebRequestCodingStrategy.RESOURCES_PATH_PREFIX.length()));
      and I changed addResourceParameters(Request request, RequestParameters parameters) in WebRequestCodingStrategy:
      StringBuffer path = new StringBuffer(WicketURLDecoder.PATH_INSTANCE.decode(pathInfo.substring(ix)));

      Attachments

        1. patch.txt
          1.0 kB
          Zbigniew Ruchała
        2. ResourceImgTest.html
          0.2 kB
          Ann Baert
        3. ResourceImgTest.java
          0.4 kB
          Ann Baert
        4. TestResourceReference.java
          9 kB
          Ann Baert

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ivaynberg Igor Vaynberg
            annb Ann Baert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment