File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -679,15 +679,17 @@ function now() {
679679}
680680
681681function getHttpData ( ) {
682+ if ( ! document . location || ! document . location . href ) {
683+ return ;
684+ }
685+
682686 var http = {
683687 headers : {
684688 'User-Agent' : navigator . userAgent
685689 }
686690 } ;
687691
688- if ( document . location && document . location . href ) {
689- http . url = document . location . href ;
690- }
692+ http . url = document . location . href ;
691693
692694 if ( document . referrer ) {
693695 http . headers . Referer = document . referrer ;
@@ -699,13 +701,18 @@ function getHttpData() {
699701function send ( data ) {
700702 if ( ! isSetup ( ) ) return ;
701703
702- data = objectMerge ( {
704+ var baseData = {
703705 project : globalProject ,
704706 logger : globalOptions . logger ,
705707 platform : 'javascript' ,
706708 // sentry.interfaces.Http
707- request : getHttpData ( )
708- } , data ) ;
709+ } ;
710+ var http = getHttpData ( ) ;
711+ if ( http ) {
712+ baseData . http = http ;
713+ }
714+
715+ data = objectMerge ( baseData , data ) ;
709716
710717 // Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
711718 data . tags = objectMerge ( objectMerge ( { } , globalOptions . tags ) , data . tags ) ;
You can’t perform that action at this time.
0 commit comments