Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-16867

MatrixVariable with Encoding does not work.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 5.0.6
    • Fix Version/s: 5.0.7, 5.1 RC1
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      false

      Description

      With both MatrixVariable enabled and UrlDecode disabled, then the PathVariables are not matched correctly.  I'm on : 5.0.6.RELEASE/spring-webmvc-5.0.6.RELEASE-sources.jar

      I have a case where I have PathVariables and MatrixVariables (plus I have encoded string as MatrixVariable value). 

      My WebConfig looks like this:

      @Configuration
      public class WebConfig implements WebMvcConfigurer {
      
       @Override
       public void configurePathMatch(PathMatchConfigurer configurer) {
         UrlPathHelper urlPathHelper = new UrlPathHelper();
         urlPathHelper.setRemoveSemicolonContent(false);
         urlPathHelper.setUrlDecode(false);
         urlPathHelper.setAlwaysUseFullPath(true);
         configurer.setUrlPathHelper(urlPathHelper);
       }
      }

      With this after the MatrixVariable extraction happens in RequestMappingInfoHandlerMapping with decoded params pointing to a newly created map, the new truncated pathVariable values are not reflected in URI_TEMPLATE_VARIABLES_ATTRIBUTE of the request. Whereas without decoding, it is referring to the old map uriVariables and things work fine. 

      I hope it explains the problem clearly. 

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rstoya05-aop Rossen Stoyanchev
                Reporter:
                aramaswa Anitha
                Last updater:
                Stéphane Nicoll
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  29 weeks, 1 day ago