Skip to content

Commit 6fd6a3c

Browse files
committed
JSESSIONID with plus sign breaks Join (fixes ocpsoft#173)
1 parent 302ece9 commit 6fd6a3c

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎config-prettyfaces/src/main/java/com/ocpsoft/pretty/PrettyContext.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class PrettyContext implements Serializable
5050
public static final String PRETTY_PREFIX = "pretty:";
5151
private static final String CONTEXT_REQUEST_KEY = "prettyContext";
5252

53-
private static final Pattern JSESSIONID_PATTERN = Pattern.compile("(?i)^(.*);jsessionid=[\\w\\.\\-]+(.*)");
53+
private static final Pattern JSESSIONID_PATTERN = Pattern.compile("(?i)^(.*);jsessionid=[\\w\\.\\-\\+]+(.*)");
5454
private static final String JSESSIONID_REPLACEMENT = "$1$2";
5555

5656
private PrettyConfig config;

‎config-servlet/src/test/java/org/ocpsoft/rewrite/servlet/config/JSessionIdHandlingTest.java‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,22 @@ public void testPathRuleMatchesWithSessionId() throws Exception
9090
assertEquals(210, action.getResponse().getStatusLine().getStatusCode());
9191
}
9292

93+
@Test
9394
public void testPathRuleMatchesWithGoogleAppEngineSessionId() throws Exception
9495
{
9596
// see: https://github.com/ocpsoft/prettyfaces/issues/15
9697
HttpAction<HttpGet> action = get("/path;jsessionid=1E-y6jzfx53ou9wymGmcfw");
9798
assertEquals(210, action.getResponse().getStatusLine().getStatusCode());
9899
}
99100

101+
@Test
102+
public void testPathRuleMatchesWithJBoss713() throws Exception
103+
{
104+
// see: https://github.com/ocpsoft/rewrite/issues/173
105+
HttpAction<HttpGet> action = get("/path;jsessionid=1E+y6jzfx53ou9wymGmcfw");
106+
assertEquals(210, action.getResponse().getStatusLine().getStatusCode());
107+
}
108+
100109
@Test
101110
public void testPathRuleMatchesWithTomcatClusterSessionId() throws Exception
102111
{

‎impl-servlet/src/main/java/org/ocpsoft/rewrite/servlet/impl/BaseHttpRewrite.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
public abstract class BaseHttpRewrite extends BaseRewrite<HttpServletRequest, HttpServletResponse> implements
3939
HttpServletRewrite
4040
{
41-
private static final Pattern JSESSIONID_PATTERN = Pattern.compile("(?i)^(.*);jsessionid=[\\w\\.\\-]+(.*)");
41+
private static final Pattern JSESSIONID_PATTERN = Pattern.compile("(?i)^(.*);jsessionid=[\\w\\.\\-\\+]+(.*)");
4242
private static final String JSESSIONID_REPLACEMENT = "$1$2";
4343

4444
/*

0 commit comments

Comments
 (0)