봄 부팅 정확한 쉼표 경로 변수 옆에

Bexter 실험실 :

나는 2.1.0.RELEASE 버전과 봄 부팅 응용 프로그램을 가지고있다.

내가 좋아하는 내 URL에서 경로 변수가 @GetMapping("/{type}/car")난 내 응용 프로그램과 함께 전화 :

http://localhost:8080/BMW;AAAAAAAAAAAAA/car 

하지만 난 단지 BMW 문자열을 얻을. 봄 정확한 쉼표와 "AAAAAAAAAAAAA"를 건너 뜁니다.

나는 필터를 적용하고 나는 그것과 같은 expereince 있습니다. 내가 좋아하는 경로 변수를 얻을 싶어 "BMW, AAAAAAAAAAAAA",하지만 난 그것을 얻을니까.

나는 그것이 보안 구멍이기 때문에, 콜 아웃이 종류를 필터링 할 이유.

Bexter 실험실 :

나는 가능한 솔루션을 찾을 수 있습니다 :

@Configuration
public class SolutionConfig extends WebMvcConfigurationSupport {

@Override
protected PathMatchConfigurer getPathMatchConfigurer() {
    PathMatchConfigurer pathMatchConfigurer = super.getPathMatchConfigurer();
    UrlPathHelper urlPathHelper = new UrlPathHelper();
    urlPathHelper.setRemoveSemicolonContent(false);
    pathMatchConfigurer.setUrlPathHelper(urlPathHelper);
    return pathMatchConfigurer;
    }
}

소스 코드 링크 : https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java

주요 메소드 이름은 "removeSemicolonContent"입니다.

추천

출처http://10.200.1.11:23101/article/api/json?id=395523&siteId=1