Class ModifyHeaders.Rule

java.lang.Object
org.microproxy.extras.ModifyHeaders.Rule
Enclosing class:
ModifyHeaders

public static final class ModifyHeaders.Rule extends Object
One rule: a header to replace on the messages a filter matches.
  • Method Details

    • of

      public static ModifyHeaders.Rule of(FlowFilter filter, String name, String value)
      A rule that sets name to value, or removes it when value is empty.
      Parameters:
      filter - the messages to change
      name - the header name
      value - the new value; empty to remove the header
      Returns:
      the rule
    • parse

      public static ModifyHeaders.Rule parse(String spec)
      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

      public FlowFilter filter()
      Returns the messages this rule changes.
      Returns:
      the messages this rule changes
    • name

      public String name()
      Returns the header name.
      Returns:
      the header name