Package org.microproxy.extras
Class ModifyHeaders.Rule
java.lang.Object
org.microproxy.extras.ModifyHeaders.Rule
- Enclosing class:
ModifyHeaders
One rule: a header to replace on the messages a filter matches.
-
Method Summary
Modifier and TypeMethodDescriptionfilter()Returns the messages this rule changes.name()Returns the header name.static ModifyHeaders.Ruleof(FlowFilter filter, String name, String value) A rule that setsnametovalue, or removes it whenvalueis empty.static ModifyHeaders.RuleParses a spec of the form[|flow-filter]|header-name|[@]header-value.
-
Method Details
-
of
A rule that setsnametovalue, or removes it whenvalueis empty.- Parameters:
filter- the messages to changename- the header namevalue- the new value; empty to remove the header- Returns:
- the rule
-
parse
Parses a spec of the form[|flow-filter]|header-name|[@]header-value.- Parameters:
spec- the spec, starting with its separator- Returns:
- the rule
- Throws:
IllegalArgumentException- if the spec is invalid or its file cannot be read
-
filter
Returns the messages this rule changes.- Returns:
- the messages this rule changes
-
name
Returns the header name.- Returns:
- the header name
-