File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,6 @@ function reactNativePlugin(Raven) {
27
27
}
28
28
29
29
function xhrTransport ( options ) {
30
- options . auth . sentry_data = JSON . stringify ( options . data ) ;
31
-
32
30
var request = new XMLHttpRequest ( ) ;
33
31
request . onreadystatechange = function ( e ) {
34
32
if ( request . readyState !== 4 ) {
@@ -46,8 +44,12 @@ function reactNativePlugin(Raven) {
46
44
}
47
45
} ;
48
46
49
- request . open ( 'GET' , options . url + '?' + urlencode ( options . auth ) ) ;
50
- request . send ( ) ;
47
+ request . open ( 'POST' , options . url + '?' + urlencode ( options . auth ) ) ;
48
+ // Sentry expects an Origin header when using HTTP POST w/ public DSN.
49
+ // Just set a phony Origin value; only matters if Sentry Project is configured
50
+ // to whitelist specific origins.
51
+ request . setRequestHeader ( 'Origin' , '<React Native>' ) ;
52
+ request . send ( JSON . stringify ( options . data ) ) ;
51
53
}
52
54
53
55
// react-native doesn't have a document, so can't use default Image
You can’t perform that action at this time.
0 commit comments