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 Rule
Rule.Handler, Rule.HttpURIHandler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Rule.Handlerapply(Rule.Handler input, Matcher matcher) Invoked after the regular expression matched the URI path to apply the rule's logic.booleanisAdd()voidsetAdd(boolean add) Set true to add the response header, false to put the response header.voidsetHeaderName(String name) voidsetHeaderValue(String value) toString()Methods inherited from class RegexRule
getRegex, isMatchQuery, matchAndApply, setMatchQuery, setRegexMethods inherited from class 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:RegexRuleInvoked after the regular expression matched the URI path to apply the rule's logic.
- Specified by:
applyin classRegexRule- Parameters:
input- the inputRequestandHandlermatcher- theMatcherthat matched the request path, with capture groups available for replacement.- Returns:
- the possibly wrapped
RequestandHandler - Throws:
IOException- if applying the rule failed
-
toString
-