Commit 7919272 1 parent bf52570 commit 7919272 Copy full SHA for 7919272
File tree 2 files changed +31
-7
lines changed
lib/datadog/tracing/distributed
sig/datadog/tracing/distributed
2 files changed +31
-7
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ def extract(data)
77
77
)
78
78
end
79
79
80
- private
80
+ private
81
81
82
82
def encode_key ( key )
83
83
key . strip . chars . map do |char |
@@ -106,18 +106,14 @@ def parse_baggage_header(baggage_header)
106
106
next unless key_value . include? ( '=' )
107
107
108
108
key , value = key_value . split ( '=' , 2 )
109
- key = decode_and_preserve_safe_characters ( key . strip , SAFE_CHARACTERS_KEY )
110
- value = decode_and_preserve_safe_characters ( value . strip , SAFE_CHARACTERS_VALUE )
109
+ key = URI . decode_www_form_component ( key . strip )
110
+ value = URI . decode_www_form_component ( value . strip )
111
111
next if key . empty? || value . empty?
112
112
113
113
baggage [ key ] = value
114
114
end
115
115
baggage
116
116
end
117
-
118
- def decode_and_preserve_safe_characters ( str , _safe_characters )
119
- URI . decode_www_form_component ( str )
120
- end
121
117
end
122
118
end
123
119
end
Original file line number Diff line number Diff line change
1
+ module Datadog
2
+ module Tracing
3
+ module Distributed
4
+ class Baggage
5
+ BAGGAGE_KEY : 'baggage'
6
+ DD_TRACE_BAGGAGE_MAX_ITEMS : 64
7
+ DD_TRACE_BAGGAGE_MAX_BYTES : 8192
8
+ SAFE_CHARACTERS_VALUE : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789$!#&'()*+-./:<>?@[]^_`{|}~"
9
+
10
+ def initialize : (fetcher: untyped , baggage_key: string) -> void
11
+
12
+ def inject! : (untyped digest, untyped data) -> (nil | untyped )
13
+
14
+ def extract : (untyped data) -> (nil | untyped )
15
+
16
+
17
+ private
18
+
19
+ def encode_key : (string key) -> string
20
+
21
+ def encode_value : (string key) -> string
22
+
23
+ def parse_baggage_header : (string baggage_header) -> hash[string, string]
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
You can’t perform that action at this time.
0 commit comments