Class CompactPathRule
java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
org.eclipse.jetty.rewrite.handler.CompactPathRule
Rewrites the URI by compacting to remove occurrences of //
and /../
.
Optionally decode the path before compacting.
Optionally canonicalize path before compacting.
isDecoding | isCanonicalizing | Input Path | Resulting Path |
---|---|---|---|
false (default) | false (default) | //foo/bar//baz |
/foo/bar/baz |
false (default) | false (default) | //foo/../bar//baz |
/bar/baz |
true | true | //foo/../bar//baz |
/bar/baz |
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static interface
Nested classes/interfaces inherited from class org.eclipse.jetty.rewrite.handler.Rule
Rule.Handler, Rule.HttpURIHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(CompactPathRule.Listener listener) boolean
boolean
matchAndApply
(Rule.Handler input) Tests whether the given inputHandler
(which wraps aRequest
) matches the rule, and if so returns an outputHandler
that applies the rule logic.boolean
removeListener
(CompactPathRule.Listener listener) void
setCanonicalizing
(boolean canonicalizing) void
setDecoding
(boolean decoding) Methods inherited from class org.eclipse.jetty.rewrite.handler.Rule
isTerminating, setTerminating, toString
-
Constructor Details
-
CompactPathRule
public CompactPathRule()
-
-
Method Details
-
addListener
-
removeListener
-
isCanonicalizing
public boolean isCanonicalizing() -
setCanonicalizing
public void setCanonicalizing(boolean canonicalizing) -
isDecoding
public boolean isDecoding() -
setDecoding
public void setDecoding(boolean decoding) -
matchAndApply
Description copied from class:Rule
Tests whether the given input
Handler
(which wraps aRequest
) matches the rule, and if so returns an outputHandler
that applies the rule logic.If the input does not match,
null
is returned.- Specified by:
matchAndApply
in classRule
- Parameters:
input
- the inputHandler
that wraps theRequest
- Returns:
- an output
Handler
that wraps the inputHandler
, ornull
if the rule does not match - Throws:
IOException
- if applying the rule fails
-