Project: Tomcat
Bug 55434 The path /foo/a/a/bar causes IllegalArgumentException when WsServerContainer creates UriTemplate
Reported: 2013-08-16 17:31:48 | Status: resolved fixed

WsFilter calls WsServerContainer.findMapping("/foo/a/a/bar"), which in turn calls new UriTemplate(path). If the path contains repeated segments, it causes the following code in the UriTemplate constructor to throw an exception: Segment old = this.segments.put(segment, new Segment(index, segment)); if (old != null) { throw new IllegalArgumentException( sm.getString("uriTemplate.duplicateName", segment)); } This would be valid if the duplicates were URI variable names but not when their plain path segments.

Files changed in fix:
java/org/apache/tomcat/websocket/server/UriTemplate.java test/org/apache/tomcat/websocket/server/TestUriTemplate.java