public TextMapPropagationRegistry(IHeadersConfig headersConfig) { var textPropagator = TextMapPropagator.NewTextMapPropagator(headersConfig); AddCodec(BuiltinFormats.TextMap, textPropagator, textPropagator); var httpHeaderPropagator = TextMapPropagator.NewHTTPHeaderPropagator(headersConfig); AddCodec(BuiltinFormats.HttpHeaders, httpHeaderPropagator, httpHeaderPropagator); }
public static TextMapPropagator NewHTTPHeaderPropagator(IHeadersConfig headersConfig) { return(new TextMapPropagator(headersConfig, HttpUtility.UrlEncode, HttpUtility.UrlDecode)); }
public static TextMapPropagator NewTextMapPropagator(IHeadersConfig headersConfig) { return(new TextMapPropagator(headersConfig, (val) => val, (val) => val)); }
public TextMapPropagator(IHeadersConfig headersConfig, Func <string, string> encodeValue, Func <string, string> decodeValue) { _headersConfig = headersConfig ?? throw new ArgumentNullException(nameof(headersConfig)); _encodeValue = encodeValue ?? throw new ArgumentNullException(nameof(encodeValue)); _decodeValue = decodeValue ?? throw new ArgumentNullException(nameof(decodeValue)); }