File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,24 +105,12 @@ export class WebTransport implements Transport {
105105
106106 if ( this . transport !== 'fetch' ) return ;
107107
108- // Keeping reference on current `window. fetch` function.
109- WebTransport . originalFetch = fetch . bind ( window ) ;
108+ // Storing reference on original ` fetch` function implementation as protection against APM lib monkey patching .
109+ WebTransport . originalFetch = WebTransport . getOriginalFetch ( ) ;
110110
111111 // Check whether `fetch` has been monkey patched or not.
112- if ( this . isFetchMonkeyPatched ( ) ) {
113- WebTransport . originalFetch = WebTransport . getOriginalFetch ( ) ;
114-
112+ if ( this . isFetchMonkeyPatched ( ) )
115113 logger . warn ( 'WebTransport' , "Native Web Fetch API 'fetch' function monkey patched." ) ;
116-
117- if ( ! this . isFetchMonkeyPatched ( WebTransport . originalFetch ) ) {
118- logger . info ( 'WebTransport' , "Use native Web Fetch API 'fetch' implementation from iframe as APM workaround." ) ;
119- } else {
120- logger . warn (
121- 'WebTransport' ,
122- 'Unable receive native Web Fetch API. There can be issues with subscribe long-poll cancellation' ,
123- ) ;
124- }
125- }
126114 }
127115
128116 makeSendable ( req : TransportRequest ) : [ Promise < TransportResponse > , CancellationController | undefined ] {
You can’t perform that action at this time.
0 commit comments