Reply To: Handle illegal hex characters in url

Splash Forums Rewrite Users Handle illegal hex characters in url Reply To: Handle illegal hex characters in url

#27345

susnet
Participant

Thank you very much!! This is working just fine!

This is how my rule now looks:

.addRule(Join.path(“/search/{query}”).to(“/pages/search.xhtml?query={query}”)).where(“query”).constrainedBy( (event, context1, value) -> {
// validate value here and return true if everything is fine
try {
URLDecoder.decode(value, “UTF-8”);
return true;
}
catch(IllegalArgumentException e) {
return false;
}
catch (UnsupportedEncodingException e) {
return false;
}
})

Thanks again!