Skip to content

Commit

Permalink
fix a typo in composite_text_map_propagator (#1590)
Browse files Browse the repository at this point in the history
  • Loading branch information
samk1 authored Feb 2, 2024
1 parent f7f851f commit c7ef408
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def extract(carrier, context: Context.current, getter: Context::Propagation.text
# @return [Array<String>] a list of fields that will be used by this propagator.
def fields
injectors = @injectors || @propagators
injectors.flat_map(&fields).uniq
injectors.flat_map(&:fields).uniq
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def inject(carrier, context:, setter: nil)
end
carrier
end

def fields
[@key]
end
end

class TestExtractor
Expand Down Expand Up @@ -124,6 +128,12 @@ def get(carrier, key)
_(context['k3']).must_equal('V3')
end
end

describe '#fields' do
it 'returns all fields from injectors' do
_(propagator.fields).must_equal(%w[k1 k2 k3])
end
end
end

describe 'with buggy injectors / extractors' do
Expand Down

0 comments on commit c7ef408

Please sign in to comment.