jetty.project
jetty.project copied to clipboard
Issue #13190 - Add CompactPathRule support for decoding and canonicalizing paths
Adding methods to CompactPathRule
setDecoding(boolean)setCanonicalizing(boolean)addListener(Listener)
My normal niggles about naming, but the approach is good. Please investigate if ComplainceListeners can be used rather than introducing a new type of listener
The ComplianceViolation.Listener takes as parameters passed into the listeners implementations ... (ComplianceViolation.Mode mode, ComplianceViolation violation, String details).
What would you suggest this be? An existing UriCompliance.Violation? or something new (like UriCompliance.Violation.PATH_NAVIGATION)?
Using ComplianceViolation.Listener feels like double work. Its difficult to fit into a mode / violation, as this CompactPathRule is an optional feature anyway. Also I think the existing violations are already being caught and reported anyway, even before we reach this new CompactPathRule.
@joakime rather than setting "canonicalizing" and "decoding" on the rule, perhaps just set a ComplianceViolation.Mode on it and it can decide to canonicalize and/or decode by looking at the violations allowed by the mode. You then have the mode and can use the same listeners.
Essentially the rule will be making corrections for the allowed violations that it supports!