File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
packages/browser/src/transports Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ export abstract class BaseTransport implements Transport {
107
107
logger . log ( `Flushing outcomes:\n${ JSON . stringify ( outcomes , null , 2 ) } ` ) ;
108
108
109
109
const url = this . _api . getEnvelopeEndpointWithUrlEncodedAuth ( ) ;
110
+ // Envelope header is required to be at least an empty object
111
+ const envelopeHeader = JSON . stringify ( { } ) ;
110
112
const itemHeaders = JSON . stringify ( {
111
113
type : 'client_report' ,
112
114
} ) ;
@@ -121,7 +123,7 @@ export abstract class BaseTransport implements Transport {
121
123
} ;
122
124
} ) ,
123
125
} ) ;
124
- const envelope = `${ itemHeaders } \n${ item } ` ;
126
+ const envelope = `${ envelopeHeader } \n ${ itemHeaders } \n${ item } ` ;
125
127
126
128
navigator . sendBeacon ( url , envelope ) ;
127
129
}
You can’t perform that action at this time.
0 commit comments