Skip to content

Commit

Permalink
#3509 'combine' mode is default
Browse files Browse the repository at this point in the history
  • Loading branch information
YegorKozlov committed Jan 22, 2025
1 parent 3542af1 commit cf95c6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public class RedirectFilter extends AnnotatedStandardMBean
@AttributeDefinition(name = "Request Paths", description = "List of paths for which redirection is allowed", type = AttributeType.STRING)
String[] paths() default {"/content"};

@AttributeDefinition(name = "Preserve Query String", description = "Deprecated. Since v6.11 you can manage handling query string in Redirect Properties.", type = AttributeType.BOOLEAN)
@AttributeDefinition(name = "Preserve Query String", description = "Preserve query string in redirects. Since v6.11 you can manage handling query string in Redirect Properties.", type = AttributeType.BOOLEAN)
boolean preserveQueryString() default true;

@AttributeDefinition(name = "Preserve Extension", description = "Whether to preserve extensions. "
Expand Down Expand Up @@ -434,7 +434,7 @@ String evaluate(RedirectMatch match, SlingHttpServletRequest slingRequest){
HandleQueryString getPreserveQueryString(RedirectRule rule){
HandleQueryString mode;
if(rule.getPreserveQueryString() == null) {
mode = config.preserveQueryString() ? HandleQueryString.REPLACE : HandleQueryString.IGNORE;
mode = config.preserveQueryString() ? HandleQueryString.COMBINE : HandleQueryString.IGNORE;
} else {
mode = HandleQueryString.valueOf(rule.getPreserveQueryString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ public void testPreserveQueryStringConfiguration() throws Exception{

assertEquals(true, filter.getConfiguration().preserveQueryString());
// inherited from the OSGi configuration, see the assert above
assertEquals(HandleQueryString.REPLACE, filter.getPreserveQueryString(rules.get("/test1")));
assertEquals(HandleQueryString.COMBINE, filter.getPreserveQueryString(rules.get("/test1")));

assertEquals(HandleQueryString.IGNORE, filter.getPreserveQueryString(rules.get("/test2")));
assertEquals(HandleQueryString.REPLACE, filter.getPreserveQueryString(rules.get("/test3")));
Expand Down

0 comments on commit cf95c6f

Please sign in to comment.