Skip to content

Commit e08ef55

Browse files
committed
Test to reproduce ocpsoft#195
1 parent 1a2c427 commit e08ef55

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,28 @@ public void testJoinEncodingSpaceCharacter() throws Exception
8383
assertThat(responseContent, containsString("getParameter('param') = foo bar"));
8484
}
8585

86+
@Test
87+
public void testJoinSupportsSingleCurlyBrace() throws Exception
88+
{
89+
HttpAction<HttpGet> action = get("/encoding/foo%7Bbar");
90+
assertEquals(200, action.getResponse().getStatusLine().getStatusCode());
91+
92+
String responseContent = action.getResponseContent();
93+
assertThat(responseContent, containsString("getRequestPath() = " + getContextPath() + "/encoding.html"));
94+
assertThat(responseContent, containsString("getParameter('param') = foo{bar"));
95+
}
96+
97+
@Test
98+
public void testJoinSupportsCurlyBraceGroup() throws Exception
99+
{
100+
HttpAction<HttpGet> action = get("/encoding/foo%7Bbar%7D");
101+
assertEquals(200, action.getResponse().getStatusLine().getStatusCode());
102+
103+
String responseContent = action.getResponseContent();
104+
assertThat(responseContent, containsString("getRequestPath() = " + getContextPath() + "/encoding.html"));
105+
assertThat(responseContent, containsString("getParameter('param') = foo{bar}"));
106+
}
107+
86108
/**
87109
* Ampersands don't have to be encoded in the path segment (rfc2396, section 3.3). Make sure this works when
88110
* transforming it into a query parameter.

0 commit comments

Comments
 (0)