ModifyHeaderInfo constructor

ModifyHeaderInfo({
  1. required String header,
  2. required HeaderOperation operation,
  3. String? value,
  4. String? regexFilter,
  5. String? regexSubstitution,
  6. HeaderRegexOptions? regexOptions,
})

Implementation

ModifyHeaderInfo({
  /// The name of the header to be modified.
  required String header,

  /// The operation to be performed on a header.
  /// <!-- TODO(crbug.com/352093575): Make this field optional: It is ignored
  /// if `regexSubstitution` is specified but is required otherwise. -->
  required HeaderOperation operation,

  /// The new value for the header. Must be specified for `append`
  /// and `set` operations.
  /// <!-- TODO(crbug.com/352093575): Ignored if `regexSubstitution` is
  /// specified, -->
  String? value,

  /// A regular expression to match against the header value. This follows the
  /// RE2 syntax for consistency with the rest of the API.
  String? regexFilter,

  /// Substitution pattern for the response header. `regexFilter` must be
  /// specified for this to be valid. Takes precedence over `value` and
  /// `operation` if specified and valid.
  String? regexSubstitution,

  /// Options for the regex filter. If not specified, all options will be
  /// default.
  HeaderRegexOptions? regexOptions,
}) : _wrapped = $js.ModifyHeaderInfo(
        header: header,
        operation: operation.toJS,
        value: value,
        regexFilter: regexFilter,
        regexSubstitution: regexSubstitution,
        regexOptions: regexOptions?.toJS,
      );