Path: redb-route/redb.Route.As2/As2HeaderFilterStrategy.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route.As2/As2HeaderFilterStrategy.cs
----
using redb.Route.Abstractions;
namespace redb.Route.As2;
///
/// The default of the AS2 component. An endpoint's
/// headerFilterStrategy=#name replaces it; derive from it to add to it.
///
/// A producer sends every exchange header but the component's own redbAs2.* and null values as an HTTP header
/// of the message; a consumer brings every request header in.
///
///
/// Whatever the strategy: the producer never bridges the MIME, AS2 and hop-by-hop fields it sets itself, the
/// credentials of another hop (Authorization, Cookie, Set-Cookie) or Host; the consumer
/// never takes the pseudo-headers, the S/MIME wrapper and hop-by-hop fields or the credentials that authenticated the
/// hop; the consumer's redbAs2.* metadata is set by the consumer.
///
///
public class As2HeaderFilterStrategy : IHeaderFilterStrategy
{
/// The default strategy of an AS2 endpoint.
public static As2HeaderFilterStrategy Default { get; } = new();
///
public virtual bool FilterOutgoing(string name, object? value, IExchange exchange)
=> value is null || As2Headers.IsRedbHeader(name);
///
public virtual bool FilterIncoming(string name, object? value, IExchange exchange) => false;
}