File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -680,12 +680,15 @@ function now() {
680
680
681
681
function getHttpData ( ) {
682
682
var http = {
683
- url : document . location . href ,
684
683
headers : {
685
684
'User-Agent' : navigator . userAgent
686
685
}
687
686
} ;
688
687
688
+ if ( document . location && document . location . href ) {
689
+ http . url = document . location . href ;
690
+ }
691
+
689
692
if ( document . referrer ) {
690
693
http . headers . Referer = document . referrer ;
691
694
}
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ describe('globals', function() {
170
170
var data = getHttpData ( ) ;
171
171
172
172
it ( 'should have a url' , function ( ) {
173
- assert . equal ( data . url , window . location . href ) ;
173
+ assert . equal ( data . url , window . location . href ) ;
174
174
} ) ;
175
175
176
176
it ( 'should have the user-agent header' , function ( ) {
@@ -185,7 +185,6 @@ describe('globals', function() {
185
185
assert . isUndefined ( data . headers . Referer ) ;
186
186
}
187
187
} ) ;
188
-
189
188
} ) ;
190
189
191
190
describe ( 'isUndefined' , function ( ) {
You can’t perform that action at this time.
0 commit comments