@@ -30,7 +30,7 @@ export function instrumentXHR(): void {
30
30
const xhrproto = XMLHttpRequest . prototype ;
31
31
32
32
fill ( xhrproto , 'open' , function ( originalOpen : ( ) => void ) : ( ) => void {
33
- return function ( this : XMLHttpRequest & SentryWrappedXMLHttpRequest , ...args : unknown [ ] ) : void {
33
+ return function open ( this : XMLHttpRequest & SentryWrappedXMLHttpRequest , ...args : unknown [ ] ) : void {
34
34
const startTimestamp = timestampInSeconds ( ) * 1000 ;
35
35
36
36
// open() should always be called with two or more arguments
@@ -81,7 +81,7 @@ export function instrumentXHR(): void {
81
81
82
82
if ( 'onreadystatechange' in this && typeof this . onreadystatechange === 'function' ) {
83
83
fill ( this , 'onreadystatechange' , function ( original : WrappedFunction ) {
84
- return function ( this : SentryWrappedXMLHttpRequest , ...readyStateArgs : unknown [ ] ) : void {
84
+ return function onreadystatechange ( this : SentryWrappedXMLHttpRequest , ...readyStateArgs : unknown [ ] ) : void {
85
85
onreadystatechangeHandler ( ) ;
86
86
return original . apply ( this , readyStateArgs ) ;
87
87
} ;
@@ -94,7 +94,7 @@ export function instrumentXHR(): void {
94
94
// This will only work for user/library defined headers, not for the default/browser-assigned headers.
95
95
// Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`.
96
96
fill ( this , 'setRequestHeader' , function ( original : WrappedFunction ) {
97
- return function ( this : SentryWrappedXMLHttpRequest , ...setRequestHeaderArgs : unknown [ ] ) : void {
97
+ return function setRequestHeader ( this : SentryWrappedXMLHttpRequest , ...setRequestHeaderArgs : unknown [ ] ) : void {
98
98
const [ header , value ] = setRequestHeaderArgs ;
99
99
100
100
const xhrInfo = this [ SENTRY_XHR_DATA_KEY ] ;
@@ -112,7 +112,7 @@ export function instrumentXHR(): void {
112
112
} ) ;
113
113
114
114
fill ( xhrproto , 'send' , function ( originalSend : ( ) => void ) : ( ) => void {
115
- return function ( this : XMLHttpRequest & SentryWrappedXMLHttpRequest , ...args : unknown [ ] ) : void {
115
+ return function send ( this : XMLHttpRequest & SentryWrappedXMLHttpRequest , ...args : unknown [ ] ) : void {
116
116
const sentryXhrData = this [ SENTRY_XHR_DATA_KEY ] ;
117
117
118
118
if ( ! sentryXhrData ) {
0 commit comments