Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
PROC-1643: Remove quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharygoodwin committed Mar 21, 2024
1 parent 91c2c42 commit d806f91
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,7 @@ private static Cookie doCreateForcedGroupsCookie(
final String contextPath, final ForceGroupsOptions forceGroupsOptions) {
// be sure to quote cookies because they have characters that are not allowed raw
final String cookieValue =
'"'
+ ForceGroupsOptionsStrings.generateForceGroupsStringForCookies(
forceGroupsOptions)
+ '"';
ForceGroupsOptionsStrings.generateForceGroupsStringForCookies(forceGroupsOptions);

final String cookiePath;
if (StringUtils.isBlank(contextPath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,13 @@ public void testSetForcedGroupsCookie() {
public void testCreateForcedGroupsCookie() {
Cookie cookie = createForcedGroupsCookie("myapp", emptyMap());
assertThat(cookie.getName()).isEqualTo("prforceGroups");
assertThat(cookie.getValue()).isEqualTo("\"\"");
assertThat(cookie.getValue()).isEqualTo("");
assertThat(cookie.getPath()).isEqualTo("myapp");
assertThat(cookie.getVersion()).isEqualTo(0);

cookie = createForcedGroupsCookie("myapp", Collections.singletonMap("foo", 2));
assertThat(cookie.getName()).isEqualTo("prforceGroups");
assertThat(cookie.getValue()).isEqualTo("\"foo2\"");
assertThat(cookie.getValue()).isEqualTo("foo2");
assertThat(cookie.getPath()).isEqualTo("myapp");
assertThat(cookie.getVersion()).isEqualTo(0);

Expand All @@ -328,7 +328,7 @@ public void testCreateForcedGroupsCookie() {
forceGroups.put("bar", 3);
cookie = createForcedGroupsCookie("myapp", forceGroups);
assertThat(cookie.getName()).isEqualTo("prforceGroups");
assertThat(cookie.getValue()).isEqualTo("\"bar3%2Cfoo2\"");
assertThat(cookie.getValue()).isEqualTo("bar3%2Cfoo2");
assertThat(cookie.getPath()).isEqualTo("myapp");
assertThat(cookie.getVersion()).isEqualTo(0);

Expand All @@ -337,7 +337,7 @@ public void testCreateForcedGroupsCookie() {

final String forceGroup = getForceGroupsStringFromRequest(request);

assertThat(forceGroup).isEqualTo("\"bar3,foo2\"");
assertThat(forceGroup).isEqualTo("bar3,foo2");
}

@Test
Expand Down

0 comments on commit d806f91

Please sign in to comment.