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 {
107107 logger . log ( `Flushing outcomes:\n${ JSON . stringify ( outcomes , null , 2 ) } ` ) ;
108108
109109 const url = this . _api . getEnvelopeEndpointWithUrlEncodedAuth ( ) ;
110+ // Envelope header is required to be at least an empty object
111+ const envelopeHeader = JSON . stringify ( { } ) ;
110112 const itemHeaders = JSON . stringify ( {
111113 type : 'client_report' ,
112114 } ) ;
@@ -121,7 +123,7 @@ export abstract class BaseTransport implements Transport {
121123 } ;
122124 } ) ,
123125 } ) ;
124- const envelope = `${ itemHeaders } \n${ item } ` ;
126+ const envelope = `${ envelopeHeader } \n ${ itemHeaders } \n${ item } ` ;
125127
126128 navigator . sendBeacon ( url , envelope ) ;
127129 }
You can’t perform that action at this time.
0 commit comments