File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -526,19 +526,30 @@ extend(Raven.prototype, {
526
526
* (eg. globalContext.request + domainContext.request + kwargs.request),
527
527
* we manually pull them out from original objects.
528
528
*
529
+ * Same scenario happens when some frameworks (eg. Koa) decide to use request within
530
+ * request. eg `this.request.req`, which adds aliases to the main `request` object.
531
+ * By manually reassigning them here, we don't need to add additional checks
532
+ * like `req.method || (req.req && req.req.method)`
533
+ *
529
534
* We don't use Object.assign/extend as it's only merging over objects own properties,
530
535
* and we don't want to go through all of the properties as well, as we simply don't
531
536
* need all of them.
532
- *
533
- * So far the only missing piece is `ip`, but we can specify what properties should
534
- * be pulled by extending `nonEnumerables` array.
535
537
**/
536
538
var sources = Array . from ( arguments ) . filter ( function ( source ) {
537
539
return Object . prototype . toString . call ( source ) === '[object Object]' ;
538
540
} ) ;
539
541
sources = [ { } ] . concat ( sources ) ;
540
542
var request = extend . apply ( null , sources ) ;
541
- var nonEnumberables = [ 'ip' ] ;
543
+ var nonEnumberables = [
544
+ 'headers' ,
545
+ 'host' ,
546
+ 'ip' ,
547
+ 'method' ,
548
+ 'protocol' ,
549
+ 'query' ,
550
+ 'secure' ,
551
+ 'url'
552
+ ] ;
542
553
543
554
nonEnumberables . forEach ( function ( key ) {
544
555
sources . forEach ( function ( source ) {
You can’t perform that action at this time.
0 commit comments