mirror of
https://github.com/apache/struts.git
synced 2026-08-07 15:46:57 +00:00
WW-2328 fix for DefaultActionMapper not parsing out the sessionid
Submitted By: Omkar Patil Reviewed By: Tom Schneider git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@597904 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -289,7 +289,10 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
ConfigurationManager configManager) {
|
||||
ActionMapping mapping = new ActionMapping();
|
||||
String uri = getUri(request);
|
||||
|
||||
|
||||
int indexOfSemicolon = uri.indexOf(";");
|
||||
uri = (indexOfSemicolon > -1) ? uri.substring(0, indexOfSemicolon) : uri;
|
||||
|
||||
uri = dropExtension(uri, mapping);
|
||||
if (uri == null) {
|
||||
return null;
|
||||
|
||||
@@ -181,6 +181,18 @@ public class DefaultActionMapperTest extends StrutsTestCase {
|
||||
ActionMapping mapping = mapper.getMapping(req, configManager);
|
||||
assertEquals("/my/namespace/actionName.action", mapper.getUriFromActionMapping(mapping));
|
||||
}
|
||||
|
||||
public void testGetUriWithSemicolonPresent() throws Exception {
|
||||
req.setupGetParameterMap(new HashMap());
|
||||
req.setupGetRequestURI("/my/namespace/actionName.action;abc=123rty56");
|
||||
req.setupGetServletPath("/my/namespace/actionName.action;abc=123rty56");
|
||||
req.setupGetAttribute(null);
|
||||
req.addExpectedGetAttributeName("javax.servlet.include.servlet_path");
|
||||
|
||||
DefaultActionMapper mapper = new DefaultActionMapper();
|
||||
ActionMapping mapping = mapper.getMapping(req, configManager);
|
||||
assertEquals("/my/namespace/actionName.action", mapper.getUriFromActionMapping(mapping));
|
||||
}
|
||||
|
||||
public void testGetUriWithMethod() throws Exception {
|
||||
req.setupGetParameterMap(new HashMap());
|
||||
|
||||
Reference in New Issue
Block a user