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() {
680680
681681function getHttpData ( ) {
682682 var http = {
683- url : document . location . href ,
684683 headers : {
685684 'User-Agent' : navigator . userAgent
686685 }
687686 } ;
688687
688+ if ( document . location && document . location . href ) {
689+ http . url = document . location . href ;
690+ }
691+
689692 if ( document . referrer ) {
690693 http . headers . Referer = document . referrer ;
691694 }
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ describe('globals', function() {
170170 var data = getHttpData ( ) ;
171171
172172 it ( 'should have a url' , function ( ) {
173- assert . equal ( data . url , window . location . href ) ;
173+ assert . equal ( data . url , window . location . href ) ;
174174 } ) ;
175175
176176 it ( 'should have the user-agent header' , function ( ) {
@@ -185,7 +185,6 @@ describe('globals', function() {
185185 assert . isUndefined ( data . headers . Referer ) ;
186186 }
187187 } ) ;
188-
189188 } ) ;
190189
191190 describe ( 'isUndefined' , function ( ) {
You can’t perform that action at this time.
0 commit comments