Class HeaderRule
java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
org.eclipse.jetty.rewrite.handler.HeaderRule
- Direct Known Subclasses:
ForwardedSchemeHeaderRule
Abstract rule that matches against request headers.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.rewrite.handler.Rule
Rule.Handler, Rule.HttpURIHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Rule.Handler
apply
(Rule.Handler input, String value) Invoked after the header matched theRequest
headers to apply the rule's logic.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.void
setHeaderName
(String header) void
setHeaderValue
(String headerValue) toString()
Methods inherited from class org.eclipse.jetty.rewrite.handler.Rule
isTerminating, setTerminating
-
Constructor Details
-
HeaderRule
public HeaderRule()
-
-
Method Details
-
getHeaderName
-
setHeaderName
-
getHeaderValue
-
setHeaderValue
- Parameters:
headerValue
- the header value to match against. Ifnull
, then the presence of the header is enough to match
-
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
-
apply
Invoked after the header matched the
Request
headers to apply the rule's logic.- Parameters:
input
- the inputRequest
andHandler
value
- the header value- Returns:
- the possibly wrapped
Request
andHandler
- Throws:
IOException
- if applying the rule failed
-
toString
-