@@ 32,6 32,11 @@ public class HeaderFilter : IFilter
}
var header = splitted[0];
if (_options.KeepHeaders is not null)
{
return _options.KeepHeaders.Contains(header);
}
return !_options.RemoveHeaders.Contains(header);
}
}
\ No newline at end of file
@@ 6,7 6,46 @@
namespace Anonymizer.Filters;
public record HeaderFilterOptions
(
IReadOnlyList<string> RemoveHeaders
);
\ No newline at end of file
/// <summary>
/// Options for <see cref="HeaderFilter"/>.
/// </summary>
public class HeaderFilterOptions
{
/// <summary>
/// Gets or sets the headers to remove. <see cref="KeepHeaders"/> is prioritized.
/// </summary>
public IReadOnlyList<string> RemoveHeaders { get; set; } = new[]
{
"mv",
"stat",
"say",
"spk",
"bn",
"inv",
"qslot",
"umi",
"msgi2",
"qnai2",
"die",
"throw",
"bf",
"bf_e",
"dm",
"finit",
"finfo",
"ptctl",
"suctl", // figure out what it does
"ct", // figure out what it does
};
/// <summary>
/// Gets or sets the headers to keep. Takes priority before remove headers.
/// </summary>
public IReadOnlyList<string>? KeepHeaders { get; set; } = null;
// rdlst, raid, raidmbf, raidbf, in, out, c_info, c_mode
}
\ No newline at end of file