File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ export function sendEvent ({
6363
6464 // Content information
6565 path : location . pathname ,
66+ hostname : location . hostname ,
6667 referrer : document . referrer ,
6768 search : location . search ,
6869 href : location . href ,
Original file line number Diff line number Diff line change @@ -39,6 +39,11 @@ const context = {
3939 description : 'The browser value of `location.pathname`.' ,
4040 format : 'uri-reference'
4141 } ,
42+ hostname : {
43+ type : 'string' ,
44+ description : 'The browser value of `location.hostname.`' ,
45+ format : 'uri-reference'
46+ } ,
4247 referrer : {
4348 type : 'string' ,
4449 description : 'The browser value of `document.referrer`.' ,
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ describe('POST /events', () => {
4848
4949 // Content information
5050 path : '/github/docs/issues' ,
51+ hostname : 'github.com' ,
5152 referrer : 'https://github.com/github/docs' ,
5253 search : '?q=is%3Aissue+is%3Aopen+example+' ,
5354 href : 'https://github.com/github/docs/issues?q=is%3Aissue+is%3Aopen+example+' ,
@@ -138,6 +139,16 @@ describe('POST /events', () => {
138139 } , 400 )
139140 )
140141
142+ it ( 'should hostname be uri-reference' , ( ) =>
143+ checkEvent ( {
144+ ...pageExample ,
145+ context : {
146+ ...pageExample . context ,
147+ hostname : ' '
148+ }
149+ } , 400 )
150+ )
151+
141152 it ( 'should referrer be uri-reference' , ( ) =>
142153 checkEvent ( {
143154 ...pageExample ,
You can’t perform that action at this time.
0 commit comments