/** * Shortcut to same property on underlying {@link #setUrlPathHelper UrlPathHelper}. * @see org.springframework.web.util.UrlPathHelper#setUrlDecode */ public void setUrlDecode(boolean urlDecode) { this.urlPathHelper.setUrlDecode(urlDecode); }
/** * Shortcut to same property on underlying {@link #setUrlPathHelper UrlPathHelper}. * @see org.springframework.web.util.UrlPathHelper#setUrlDecode */ public void setUrlDecode(boolean urlDecode) { this.urlPathHelper.setUrlDecode(urlDecode); }
/** * Set if context path and request URI should be URL-decoded. * Both are returned <i>undecoded</i> by the Servlet API, * in contrast to the servlet path. * <p>Uses either the request encoding or the default encoding according * to the Servlet spec (ISO-8859-1). * @see org.springframework.web.util.UrlPathHelper#setUrlDecode */ public void setUrlDecode(boolean urlDecode) { this.urlPathHelper.setUrlDecode(urlDecode); }
/** * Shortcut to same property on underlying {@link #setUrlPathHelper UrlPathHelper}. * <p>Only relevant for the "cacheMappings" setting. * @see #setCacheMappings * @see org.springframework.web.util.UrlPathHelper#setUrlDecode */ public void setUrlDecode(boolean urlDecode) { this.urlPathHelper.setUrlDecode(urlDecode); }
/** * Shortcut to same property on underlying {@link #setUrlPathHelper UrlPathHelper}. * @see org.springframework.web.util.UrlPathHelper#setUrlDecode */ public void setUrlDecode(boolean urlDecode) { this.urlPathHelper.setUrlDecode(urlDecode); }
/** * Shortcut to same property on underlying {@link #setUrlPathHelper UrlPathHelper}. * @see org.springframework.web.util.UrlPathHelper#setUrlDecode */ public void setUrlDecode(boolean urlDecode) { this.urlPathHelper.setUrlDecode(urlDecode); }
/** * Shortcut to same property on underlying {@link #setUrlPathHelper UrlPathHelper}. * <p>Only relevant for the "cacheMappings" setting. * @see #setCacheMappings * @see org.springframework.web.util.UrlPathHelper#setUrlDecode */ public void setUrlDecode(boolean urlDecode) { this.urlPathHelper.setUrlDecode(urlDecode); }
/** * Set if context path and request URI should be URL-decoded. * Both are returned <i>undecoded</i> by the Servlet API, * in contrast to the servlet path. * <p>Uses either the request encoding or the default encoding according * to the Servlet spec (ISO-8859-1). * @see org.springframework.web.util.UrlPathHelper#setUrlDecode */ public void setUrlDecode(boolean urlDecode) { this.urlPathHelper.setUrlDecode(urlDecode); }
/** * Shortcut to same property on underlying {@link #setUrlPathHelper UrlPathHelper}. * @see org.springframework.web.util.UrlPathHelper#setUrlDecode(boolean) */ public void setUrlDecode(boolean urlDecode) { this.urlPathHelper.setUrlDecode(urlDecode); if (this.corsConfigurationSource instanceof UrlBasedCorsConfigurationSource) { ((UrlBasedCorsConfigurationSource)this.corsConfigurationSource).setUrlDecode(urlDecode); } }
/** * Create an instance with the given map of file extensions and media types. */ public PathExtensionContentNegotiationStrategy(@Nullable Map<String, MediaType> mediaTypes) { super(mediaTypes); setUseRegisteredExtensionsOnly(false); setIgnoreUnknownExtensions(true); this.urlPathHelper.setUrlDecode(false); }
public ForwardedHeaderFilter() { this.pathHelper = new UrlPathHelper(); this.pathHelper.setUrlDecode(false); this.pathHelper.setRemoveSemicolonContent(false); }
/** * Shortcut to same property on underlying {@link #setUrlPathHelper UrlPathHelper}. * @see org.springframework.web.util.UrlPathHelper#setUrlDecode(boolean) */ public void setUrlDecode(boolean urlDecode) { this.urlPathHelper.setUrlDecode(urlDecode); if (this.corsConfigurationSource instanceof UrlBasedCorsConfigurationSource) { ((UrlBasedCorsConfigurationSource)this.corsConfigurationSource).setUrlDecode(urlDecode); } }
/** * Create an instance with the given map of file extensions and media types. */ public PathExtensionContentNegotiationStrategy(@Nullable Map<String, MediaType> mediaTypes) { super(mediaTypes); setUseRegisteredExtensionsOnly(false); setIgnoreUnknownExtensions(true); this.urlPathHelper.setUrlDecode(false); }
public ForwardedHeaderFilter() { this.pathHelper = new UrlPathHelper(); this.pathHelper.setUrlDecode(false); this.pathHelper.setRemoveSemicolonContent(false); }
@Test public void getPathWithinServletWithoutUrlDecoding() { request.setContextPath("/SPR-11101"); request.setServletPath("/test_url_decoding/a/b"); request.setRequestURI("/test_url_decoding/a%2Fb"); helper.setUrlDecode(false); String actual = helper.getPathWithinServletMapping(request); assertEquals("/test_url_decoding/a%2Fb", actual); }
@Test // SPR-10140, SPR-16867 public void handleMatchMatrixVariablesDecoding() { MockHttpServletRequest request; UrlPathHelper urlPathHelper = new UrlPathHelper(); urlPathHelper.setUrlDecode(false); urlPathHelper.setRemoveSemicolonContent(false); this.handlerMapping.setUrlPathHelper(urlPathHelper); request = new MockHttpServletRequest(); handleMatch(request, "/{cars}", "/cars;mvar=a%2Fb"); MultiValueMap<String, String> matrixVariables = getMatrixVariables(request, "cars"); Map<String, String> uriVariables = getUriTemplateVariables(request); assertNotNull(matrixVariables); assertEquals(Collections.singletonList("a/b"), matrixVariables.get("mvar")); assertEquals("cars", uriVariables.get("cars")); }
@SuppressWarnings("unchecked") @Test // SPR-9098 public void handleMatchUriTemplateVariablesDecode() { RequestMappingInfo key = RequestMappingInfo.paths("/{group}/{identifier}").build(); MockHttpServletRequest request = new MockHttpServletRequest("GET", "/group/a%2Fb"); UrlPathHelper pathHelper = new UrlPathHelper(); pathHelper.setUrlDecode(false); String lookupPath = pathHelper.getLookupPathForRequest(request); this.handlerMapping.setUrlPathHelper(pathHelper); this.handlerMapping.handleMatch(key, lookupPath, request); String name = HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE; Map<String, String> uriVariables = (Map<String, String>) request.getAttribute(name); assertNotNull(uriVariables); assertEquals("group", uriVariables.get("group")); assertEquals("a/b", uriVariables.get("identifier")); }
/** * Set if context path and request URI should be URL-decoded. * Both are returned <i>undecoded</i> by the Servlet API, * in contrast to the servlet path. * <p>Uses either the request encoding or the default encoding according * to the Servlet spec (ISO-8859-1). * @see org.springframework.web.util.UrlPathHelper#setUrlDecode */ public void setUrlDecode(boolean urlDecode) { this.urlPathHelper.setUrlDecode(urlDecode); }
/** * Set if context path and request URI should be URL-decoded. Both are returned * <i>undecoded</i> by the Servlet API, in contrast to the servlet path. * <p>Uses either the request encoding or the default encoding according * to the Servlet spec (ISO-8859-1). * @see org.springframework.web.util.UrlPathHelper#setUrlDecode */ public void setUrlDecode(boolean urlDecode) { this.urlPathHelper.setUrlDecode(urlDecode); this.globalCorsConfigSource.setUrlDecode(urlDecode); }
/** * Shortcut to same property on underlying {@link #setUrlPathHelper UrlPathHelper}. * @see org.springframework.web.util.UrlPathHelper#setUrlDecode */ public void setUrlDecode(boolean urlDecode) { this.urlPathHelper.setUrlDecode(urlDecode); }