Class HeaderRegexRule
java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
org.eclipse.jetty.rewrite.handler.RegexRule
org.eclipse.jetty.rewrite.handler.HeaderRegexRule
Puts or adds a response header whenever the rule matches a path regex pattern.
-
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 Rule.Handler
apply
(Rule.Handler input, Matcher matcher) Invoked after the regular expression matched the URI path to apply the rule's logic.boolean
isAdd()
void
setAdd
(boolean add) Set true to add the response header, false to put the response header.void
setHeaderName
(String name) void
setHeaderValue
(String value) toString()
Methods inherited from class org.eclipse.jetty.rewrite.handler.RegexRule
getRegex, matchAndApply, setRegex
Methods inherited from class org.eclipse.jetty.rewrite.handler.Rule
isTerminating, setTerminating
-
Constructor Details
-
HeaderRegexRule
public HeaderRegexRule() -
HeaderRegexRule
-
-
Method Details
-
getHeaderName
-
setHeaderName
-
getHeaderValue
-
setHeaderValue
-
isAdd
public boolean isAdd() -
setAdd
public void setAdd(boolean add) Set true to add the response header, false to put the response header.- Parameters:
add
- true to add the response header, false to put the response header.
-
apply
Description copied from class:RegexRule
Invoked after the regular expression matched the URI path to apply the rule's logic.
- Specified by:
apply
in classRegexRule
- Parameters:
input
- the inputRequest
andHandler
matcher
- theMatcher
that matched the request path, with capture groups available for replacement.- Returns:
- the possibly wrapped
Request
andHandler
- Throws:
IOException
- if applying the rule failed
-
toString
-