File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
packages/core/src/rum/instrumentation/resourceTracking/requestProxy/XHRProxy Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -103,4 +103,15 @@ describe('formatBaggageHeader', () => {
103103 const result = formatBaggageHeader ( entries ) ;
104104 expect ( result ) . toBe ( 'first=1,second=2,third=3' ) ;
105105 } ) ;
106+
107+ it ( 'should trim keys and values' , ( ) => {
108+ const entries = new Set ( [
109+ 'traceId=abc123;sampled=true;debug' ,
110+ 'test1 = this is a test'
111+ ] ) ;
112+ const result = formatBaggageHeader ( entries ) ;
113+ expect ( result ) . toBe (
114+ 'traceId=abc123;sampled=true;debug,test1=this%20is%20a%20test'
115+ ) ;
116+ } ) ;
106117} ) ;
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ export function formatBaggageHeader(entries: Set<string>): string | null {
102102
103103 if ( formattedParts . length > MAX_MEMBERS ) {
104104 InternalLog . log (
105- `XHRProxy: Too many baggage members: ${ formattedParts . length } > ${ MAX_MEMBERS } - entries might be dropped (https://www.w3.org/TR/baggage/#limits)` ,
105+ `XHRProxy: Too many baggage members: ${ formattedParts . length } > ${ MAX_MEMBERS } - entries may be dropped (https://www.w3.org/TR/baggage/#limits)` ,
106106 SdkVerbosity . WARN
107107 ) ;
108108 } else if ( formattedParts . length === 0 ) {
@@ -114,7 +114,7 @@ export function formatBaggageHeader(entries: Set<string>): string | null {
114114
115115 if ( byteLength > MAX_BYTES ) {
116116 InternalLog . log (
117- `Baggage header too large: ${ byteLength } bytes > ${ MAX_BYTES } - entries might be dropped (https://www.w3.org/TR/baggage/#limits)` ,
117+ `Baggage header too large: ${ byteLength } bytes > ${ MAX_BYTES } - entries may be dropped (https://www.w3.org/TR/baggage/#limits)` ,
118118 SdkVerbosity . WARN
119119 ) ;
120120 }
You can’t perform that action at this time.
0 commit comments