1
- /*! Raven.js 1.1.21 (8995c6d ) | github.com/getsentry/raven-js */
1
+ /*! Raven.js 1.1.22 (6278810 ) | github.com/getsentry/raven-js */
2
2
3
3
/*
4
4
* Includes TraceKit
@@ -1101,7 +1101,6 @@ var _Raven = window.Raven,
1101
1101
maxMessageLength : 100 ,
1102
1102
extra : { }
1103
1103
} ,
1104
- authQueryString ,
1105
1104
isRavenInstalled = false ,
1106
1105
objectPrototype = Object . prototype ,
1107
1106
// capture references to window.console *and* all its methods first
@@ -1119,7 +1118,7 @@ for (var method in originalConsole) {
1119
1118
* @this {Raven}
1120
1119
*/
1121
1120
var Raven = {
1122
- VERSION : '1.1.21 ' ,
1121
+ VERSION : '1.1.22 ' ,
1123
1122
1124
1123
debug : true ,
1125
1124
@@ -1192,8 +1191,6 @@ var Raven = {
1192
1191
1193
1192
TraceKit . collectWindowErrors = ! ! globalOptions . collectWindowErrors ;
1194
1193
1195
- setAuthQueryString ( ) ;
1196
-
1197
1194
// return for chaining
1198
1195
return Raven ;
1199
1196
} ,
@@ -1586,15 +1583,6 @@ function each(obj, callback) {
1586
1583
}
1587
1584
}
1588
1585
1589
-
1590
- function setAuthQueryString ( ) {
1591
- authQueryString =
1592
- '?sentry_version=4' +
1593
- '&sentry_client=raven-js/' + Raven . VERSION +
1594
- '&sentry_key=' + globalKey ;
1595
- }
1596
-
1597
-
1598
1586
function handleStackInfo ( stackInfo , options ) {
1599
1587
var frames = [ ] ;
1600
1588
@@ -1693,7 +1681,7 @@ function extractContextFromFrame(frame) {
1693
1681
function processException ( type , message , fileurl , lineno , frames , options ) {
1694
1682
var stacktrace , i , fullMessage ;
1695
1683
1696
- if ( globalOptions . ignoreErrors . test ( message ) ) return ;
1684
+ if ( ! ! globalOptions . ignoreErrors . test && globalOptions . ignoreErrors . test ( message ) ) return ;
1697
1685
1698
1686
message += '' ;
1699
1687
message = truncate ( message , globalOptions . maxMessageLength ) ;
@@ -1717,8 +1705,8 @@ function processException(type, message, fileurl, lineno, frames, options) {
1717
1705
} ;
1718
1706
}
1719
1707
1720
- if ( globalOptions . ignoreUrls && globalOptions . ignoreUrls . test ( fileurl ) ) return ;
1721
- if ( globalOptions . whitelistUrls && ! globalOptions . whitelistUrls . test ( fileurl ) ) return ;
1708
+ if ( ! ! globalOptions . ignoreUrls . test && globalOptions . ignoreUrls . test ( fileurl ) ) return ;
1709
+ if ( ! ! globalOptions . whitelistUrls . test && ! globalOptions . whitelistUrls . test ( fileurl ) ) return ;
1722
1710
1723
1711
// Fire away!
1724
1712
send (
@@ -1826,35 +1814,46 @@ function send(data) {
1826
1814
// Set lastEventId after we know the error should actually be sent
1827
1815
lastEventId = data . event_id || ( data . event_id = uuid4 ( ) ) ;
1828
1816
1829
- makeRequest ( data ) ;
1830
- }
1817
+ logDebug ( 'debug' , 'Raven about to send:' , data ) ;
1831
1818
1819
+ if ( ! isSetup ( ) ) return ;
1832
1820
1833
- function makeRequest ( data ) {
1834
- var img ,
1835
- src ;
1821
+ ( globalOptions . transport || makeRequest ) ( {
1822
+ url : globalServer ,
1823
+ auth : {
1824
+ sentry_version : '4' ,
1825
+ sentry_client : 'raven-js/' + Raven . VERSION ,
1826
+ sentry_key : globalKey
1827
+ } ,
1828
+ data : data ,
1829
+ options : globalOptions ,
1830
+ onSuccess : function success ( ) {
1831
+ triggerEvent ( 'success' , {
1832
+ data : data ,
1833
+ src : globalServer
1834
+ } ) ;
1835
+ } ,
1836
+ onError : function failure ( ) {
1837
+ triggerEvent ( 'failure' , {
1838
+ data : data ,
1839
+ src : globalServer
1840
+ } ) ;
1841
+ }
1842
+ } ) ;
1843
+ }
1836
1844
1837
- logDebug ( 'debug' , 'Raven about to send:' , data ) ;
1845
+ function makeRequest ( opts ) {
1846
+ // Tack on sentry_data to auth options, which get urlencoded
1847
+ opts . auth . sentry_data = JSON . stringify ( opts . data ) ;
1838
1848
1839
- if ( ! isSetup ( ) ) return ;
1849
+ var img = newImage ( ) ,
1850
+ src = opts . url + '?' + urlencode ( opts . auth ) ;
1840
1851
1841
- img = newImage ( ) ;
1842
- src = globalServer + authQueryString + '&sentry_data=' + encodeURIComponent ( JSON . stringify ( data ) ) ;
1843
- if ( globalOptions . crossOrigin || globalOptions . crossOrigin === '' ) {
1844
- img . crossOrigin = globalOptions . crossOrigin ;
1852
+ if ( opts . options . crossOrigin || opts . options . crossOrigin === '' ) {
1853
+ img . crossOrigin = opts . options . crossOrigin ;
1845
1854
}
1846
- img . onload = function success ( ) {
1847
- triggerEvent ( 'success' , {
1848
- data : data ,
1849
- src : src
1850
- } ) ;
1851
- } ;
1852
- img . onerror = img . onabort = function failure ( ) {
1853
- triggerEvent ( 'failure' , {
1854
- data : data ,
1855
- src : src
1856
- } ) ;
1857
- } ;
1855
+ img . onload = opts . onSuccess ;
1856
+ img . onerror = img . onabort = opts . onError ;
1858
1857
img . src = src ;
1859
1858
}
1860
1859
@@ -1948,6 +1947,15 @@ function afterLoad() {
1948
1947
Raven . config ( RavenConfig . dsn , RavenConfig . config ) . install ( ) ;
1949
1948
}
1950
1949
}
1950
+
1951
+ function urlencode ( o ) {
1952
+ var pairs = [ ] ;
1953
+ each ( o , function ( key , value ) {
1954
+ pairs . push ( encodeURIComponent ( key ) + '=' + encodeURIComponent ( value ) ) ;
1955
+ } ) ;
1956
+ return pairs . join ( '&' ) ;
1957
+ }
1958
+
1951
1959
afterLoad ( ) ;
1952
1960
1953
1961
// Expose Raven to the world
0 commit comments