@@ -54,12 +54,11 @@ extend(Raven.prototype, {
54
54
this . root = options . root || global . process . cwd ( ) ;
55
55
this . transport = options . transport || transports [ this . dsn . protocol ] ;
56
56
this . sendTimeout = options . sendTimeout || 1 ;
57
- this . release = options . release || global . process . env . SENTRY_RELEASE || '' ;
57
+ this . release = options . release || global . process . env . SENTRY_RELEASE ;
58
58
this . environment =
59
59
options . environment ||
60
60
global . process . env . SENTRY_ENVIRONMENT ||
61
- global . process . env . NODE_ENV ||
62
- '' ;
61
+ global . process . env . NODE_ENV ;
63
62
64
63
// autoBreadcrumbs: true enables all, autoBreadcrumbs: false disables all
65
64
// autoBreadcrumbs: { http: true } enables a single type
@@ -68,7 +67,7 @@ extend(Raven.prototype, {
68
67
this . maxBreadcrumbs = Math . max ( 0 , Math . min ( options . maxBreadcrumbs || 30 , 100 ) ) ;
69
68
70
69
this . captureUnhandledRejections = options . captureUnhandledRejections ;
71
- this . loggerName = options . logger || '' ;
70
+ this . loggerName = options . logger ;
72
71
this . dataCallback = options . dataCallback ;
73
72
this . shouldSendCallback = options . shouldSendCallback ;
74
73
this . sampleRate = typeof options . sampleRate === 'undefined' ? 1 : options . sampleRate ;
@@ -266,11 +265,14 @@ extend(Raven.prototype, {
266
265
kwargs . timestamp = new Date ( ) . toISOString ( ) . split ( '.' ) [ 0 ] ;
267
266
kwargs . project = this . dsn . project_id ;
268
267
kwargs . platform = 'node' ;
268
+ kwargs . release = this . release ;
269
269
270
- // Only include release information if it is set
271
- if ( this . release ) {
272
- kwargs . release = this . release ;
273
- }
270
+ // Cleanup empty properties before sending them to the server
271
+ Object . keys ( kwargs ) . forEach ( function ( key ) {
272
+ if ( typeof kwargs [ key ] === 'undefined' || kwargs [ key ] === '' ) {
273
+ delete kwargs [ key ] ;
274
+ }
275
+ } ) ;
274
276
275
277
if ( this . dataCallback ) {
276
278
kwargs = this . dataCallback ( kwargs ) ;
0 commit comments