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() {
679
679
}
680
680
681
681
function getHttpData ( ) {
682
+ if ( ! document . location || ! document . location . href ) {
683
+ return ;
684
+ }
685
+
682
686
var http = {
683
687
headers : {
684
688
'User-Agent' : navigator . userAgent
685
689
}
686
690
} ;
687
691
688
- if ( document . location && document . location . href ) {
689
- http . url = document . location . href ;
690
- }
692
+ http . url = document . location . href ;
691
693
692
694
if ( document . referrer ) {
693
695
http . headers . Referer = document . referrer ;
@@ -699,13 +701,18 @@ function getHttpData() {
699
701
function send ( data ) {
700
702
if ( ! isSetup ( ) ) return ;
701
703
702
- data = objectMerge ( {
704
+ var baseData = {
703
705
project : globalProject ,
704
706
logger : globalOptions . logger ,
705
707
platform : 'javascript' ,
706
708
// 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 ) ;
709
716
710
717
// Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
711
718
data . tags = objectMerge ( objectMerge ( { } , globalOptions . tags ) , data . tags ) ;
You can’t perform that action at this time.
0 commit comments