Skip to content

a Uri Value is incorrectly extracted if it contains '.'. [SPR-6164] #10832

@spring-projects-issues

Description

@spring-projects-issues

Zhou Wu opened SPR-6164 and commented

Suppose we have the controller request mapping as the following

@RequestMapping(value = "/my/{vari}", method = RequestMethod.GET)
@ResponseBody
public String getVari(@PathVariable String vari) {
System.out.println("vari=" + vari);
return vari;
}

If a request such as "http://localhost/myapp/my/abc.mycontroller.com" is submitted, the actually value of 'vari' obtained by Spring API only returns 'abc.mycontroller'.

Further investigation turns out the issue is at line 564 in https://src.springframework.org/svn/spring-framework/tags/spring-framework-3.0.0.RC1/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter.java. The pattern generated by the line results in "{vari}.". With the 'pathMatcher' (the matcher used at line 565) object created by AntPathStringMatcher("{vari}.", "abc.mycontroller.com", map), the value of 'vari' will be 'abc.mycontroller' in the 'map' variable after executing line 566.


Affects: 3.0 M4, 3.0 RC1

Attachments:

Issue Links:

Referenced from: commits 8292491, e24e768

2 votes, 11 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions