@@ -1569,7 +1569,7 @@ describe('OC.SetupChecks tests', function() {
15691569 msg : 'The "X-Content-Type-Options" HTTP header is not set to "nosniff". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.' ,
15701570 type : OC . SetupChecks . MESSAGE_TYPE_WARNING
15711571 } , {
1572- msg : 'The "X-Robots-Tag" HTTP header is not set to "none ". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.' ,
1572+ msg : 'The "X-Robots-Tag" HTTP header is not set to "noindex, nofollow ". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.' ,
15731573 type : OC . SetupChecks . MESSAGE_TYPE_WARNING
15741574 } , {
15751575 msg : 'The "X-Frame-Options" HTTP header is not set to "SAMEORIGIN". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.' ,
@@ -1596,7 +1596,7 @@ describe('OC.SetupChecks tests', function() {
15961596 suite . server . requests [ 0 ] . respond (
15971597 200 ,
15981598 {
1599- 'X-Robots-Tag' : 'none ' ,
1599+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
16001600 'X-Frame-Options' : 'SAMEORIGIN' ,
16011601 'Strict-Transport-Security' : 'max-age=15768000;preload' ,
16021602 'X-Permitted-Cross-Domain-Policies' : 'none' ,
@@ -1627,7 +1627,7 @@ describe('OC.SetupChecks tests', function() {
16271627 {
16281628 'X-XSS-Protection' : '1; mode=block' ,
16291629 'X-Content-Type-Options' : 'nosniff' ,
1630- 'X-Robots-Tag' : 'none ' ,
1630+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
16311631 'X-Frame-Options' : 'SAMEORIGIN' ,
16321632 'Strict-Transport-Security' : 'max-age=15768000' ,
16331633 'X-Permitted-Cross-Domain-Policies' : 'none' ,
@@ -1641,6 +1641,49 @@ describe('OC.SetupChecks tests', function() {
16411641 } ) ;
16421642 } ) ;
16431643
1644+ describe ( 'check X-Robots-Tag header' , function ( ) {
1645+ it ( 'should return no message if X-Robots-Tag is set to noindex,nofollow without space' , function ( done ) {
1646+ protocolStub . returns ( 'https' ) ;
1647+ var result = OC . SetupChecks . checkGeneric ( ) ;
1648+ suite . server . requests [ 0 ] . respond ( 200 , {
1649+ 'Strict-Transport-Security' : 'max-age=15768000' ,
1650+ 'X-XSS-Protection' : '1; mode=block' ,
1651+ 'X-Content-Type-Options' : 'nosniff' ,
1652+ 'X-Robots-Tag' : 'noindex,nofollow' ,
1653+ 'X-Frame-Options' : 'SAMEORIGIN' ,
1654+ 'X-Permitted-Cross-Domain-Policies' : 'none' ,
1655+ 'Referrer-Policy' : 'no-referrer' ,
1656+ } ) ;
1657+ result . done ( function ( data , s , x ) {
1658+ expect ( data ) . toEqual ( [ ] ) ;
1659+ done ( ) ;
1660+ } ) ;
1661+ } ) ;
1662+
1663+ it ( 'should return a message if X-Robots-Tag is set to none' , function ( done ) {
1664+ protocolStub . returns ( 'https' ) ;
1665+ var result = OC . SetupChecks . checkGeneric ( ) ;
1666+ suite . server . requests [ 0 ] . respond ( 200 , {
1667+ 'Strict-Transport-Security' : 'max-age=15768000' ,
1668+ 'X-XSS-Protection' : '1; mode=block' ,
1669+ 'X-Content-Type-Options' : 'nosniff' ,
1670+ 'X-Robots-Tag' : 'none' ,
1671+ 'X-Frame-Options' : 'SAMEORIGIN' ,
1672+ 'X-Permitted-Cross-Domain-Policies' : 'none' ,
1673+ 'Referrer-Policy' : 'no-referrer' ,
1674+ } ) ;
1675+ result . done ( function ( data , s , x ) {
1676+ expect ( data ) . toEqual ( [
1677+ {
1678+ msg : 'The "X-Robots-Tag" HTTP header is not set to "noindex, nofollow". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.' ,
1679+ type : OC . SetupChecks . MESSAGE_TYPE_WARNING
1680+ }
1681+ ] ) ;
1682+ done ( ) ;
1683+ } ) ;
1684+ } ) ;
1685+ } ) ;
1686+
16441687 describe ( 'check X-XSS-Protection header' , function ( ) {
16451688 it ( 'should return no message if X-XSS-Protection is set to 1; mode=block; report=https://example.com' , function ( done ) {
16461689 protocolStub . returns ( 'https' ) ;
@@ -1650,7 +1693,7 @@ describe('OC.SetupChecks tests', function() {
16501693 'Strict-Transport-Security' : 'max-age=15768000' ,
16511694 'X-XSS-Protection' : '1; mode=block; report=https://example.com' ,
16521695 'X-Content-Type-Options' : 'nosniff' ,
1653- 'X-Robots-Tag' : 'none ' ,
1696+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
16541697 'X-Frame-Options' : 'SAMEORIGIN' ,
16551698 'X-Permitted-Cross-Domain-Policies' : 'none' ,
16561699 'Referrer-Policy' : 'no-referrer' ,
@@ -1670,7 +1713,7 @@ describe('OC.SetupChecks tests', function() {
16701713 'Strict-Transport-Security' : 'max-age=15768000' ,
16711714 'X-XSS-Protection' : '1; mode=block' ,
16721715 'X-Content-Type-Options' : 'nosniff' ,
1673- 'X-Robots-Tag' : 'none ' ,
1716+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
16741717 'X-Frame-Options' : 'SAMEORIGIN' ,
16751718 'X-Permitted-Cross-Domain-Policies' : 'none' ,
16761719 'Referrer-Policy' : 'no-referrer' ,
@@ -1690,7 +1733,7 @@ describe('OC.SetupChecks tests', function() {
16901733 'Strict-Transport-Security' : 'max-age=15768000' ,
16911734 'X-XSS-Protection' : '1' ,
16921735 'X-Content-Type-Options' : 'nosniff' ,
1693- 'X-Robots-Tag' : 'none ' ,
1736+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
16941737 'X-Frame-Options' : 'SAMEORIGIN' ,
16951738 'X-Permitted-Cross-Domain-Policies' : 'none' ,
16961739 'Referrer-Policy' : 'no-referrer' ,
@@ -1715,7 +1758,7 @@ describe('OC.SetupChecks tests', function() {
17151758 'Strict-Transport-Security' : 'max-age=15768000' ,
17161759 'X-XSS-Protection' : '0' ,
17171760 'X-Content-Type-Options' : 'nosniff' ,
1718- 'X-Robots-Tag' : 'none ' ,
1761+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
17191762 'X-Frame-Options' : 'SAMEORIGIN' ,
17201763 'X-Permitted-Cross-Domain-Policies' : 'none' ,
17211764 'Referrer-Policy' : 'no-referrer' ,
@@ -1742,7 +1785,7 @@ describe('OC.SetupChecks tests', function() {
17421785 'Strict-Transport-Security' : 'max-age=15768000' ,
17431786 'X-XSS-Protection' : '1; mode=block' ,
17441787 'X-Content-Type-Options' : 'nosniff' ,
1745- 'X-Robots-Tag' : 'none ' ,
1788+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
17461789 'X-Frame-Options' : 'SAMEORIGIN' ,
17471790 'X-Permitted-Cross-Domain-Policies' : 'none' ,
17481791 'Referrer-Policy' : 'no-referrer' ,
@@ -1762,7 +1805,7 @@ describe('OC.SetupChecks tests', function() {
17621805 'Strict-Transport-Security' : 'max-age=15768000' ,
17631806 'X-XSS-Protection' : '1; mode=block' ,
17641807 'X-Content-Type-Options' : 'nosniff' ,
1765- 'X-Robots-Tag' : 'none ' ,
1808+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
17661809 'X-Frame-Options' : 'SAMEORIGIN' ,
17671810 'X-Permitted-Cross-Domain-Policies' : 'none' ,
17681811 'Referrer-Policy' : 'no-referrer-when-downgrade' ,
@@ -1782,7 +1825,7 @@ describe('OC.SetupChecks tests', function() {
17821825 'Strict-Transport-Security' : 'max-age=15768000' ,
17831826 'X-XSS-Protection' : '1; mode=block' ,
17841827 'X-Content-Type-Options' : 'nosniff' ,
1785- 'X-Robots-Tag' : 'none ' ,
1828+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
17861829 'X-Frame-Options' : 'SAMEORIGIN' ,
17871830 'X-Permitted-Cross-Domain-Policies' : 'none' ,
17881831 'Referrer-Policy' : 'strict-origin' ,
@@ -1802,7 +1845,7 @@ describe('OC.SetupChecks tests', function() {
18021845 'Strict-Transport-Security' : 'max-age=15768000' ,
18031846 'X-XSS-Protection' : '1; mode=block' ,
18041847 'X-Content-Type-Options' : 'nosniff' ,
1805- 'X-Robots-Tag' : 'none ' ,
1848+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
18061849 'X-Frame-Options' : 'SAMEORIGIN' ,
18071850 'X-Permitted-Cross-Domain-Policies' : 'none' ,
18081851 'Referrer-Policy' : 'strict-origin-when-cross-origin' ,
@@ -1822,7 +1865,7 @@ describe('OC.SetupChecks tests', function() {
18221865 'Strict-Transport-Security' : 'max-age=15768000' ,
18231866 'X-XSS-Protection' : '1; mode=block' ,
18241867 'X-Content-Type-Options' : 'nosniff' ,
1825- 'X-Robots-Tag' : 'none ' ,
1868+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
18261869 'X-Frame-Options' : 'SAMEORIGIN' ,
18271870 'X-Permitted-Cross-Domain-Policies' : 'none' ,
18281871 'Referrer-Policy' : 'same-origin' ,
@@ -1842,7 +1885,7 @@ describe('OC.SetupChecks tests', function() {
18421885 'Strict-Transport-Security' : 'max-age=15768000' ,
18431886 'X-XSS-Protection' : '1; mode=block' ,
18441887 'X-Content-Type-Options' : 'nosniff' ,
1845- 'X-Robots-Tag' : 'none ' ,
1888+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
18461889 'X-Frame-Options' : 'SAMEORIGIN' ,
18471890 'X-Permitted-Cross-Domain-Policies' : 'none' ,
18481891 'Referrer-Policy' : 'origin' ,
@@ -1867,7 +1910,7 @@ describe('OC.SetupChecks tests', function() {
18671910 'Strict-Transport-Security' : 'max-age=15768000' ,
18681911 'X-XSS-Protection' : '1; mode=block' ,
18691912 'X-Content-Type-Options' : 'nosniff' ,
1870- 'X-Robots-Tag' : 'none ' ,
1913+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
18711914 'X-Frame-Options' : 'SAMEORIGIN' ,
18721915 'X-Permitted-Cross-Domain-Policies' : 'none' ,
18731916 'Referrer-Policy' : 'origin-when-cross-origin' ,
@@ -1892,7 +1935,7 @@ describe('OC.SetupChecks tests', function() {
18921935 'Strict-Transport-Security' : 'max-age=15768000' ,
18931936 'X-XSS-Protection' : '1; mode=block' ,
18941937 'X-Content-Type-Options' : 'nosniff' ,
1895- 'X-Robots-Tag' : 'none ' ,
1938+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
18961939 'X-Frame-Options' : 'SAMEORIGIN' ,
18971940 'X-Permitted-Cross-Domain-Policies' : 'none' ,
18981941 'Referrer-Policy' : 'unsafe-url' ,
@@ -1919,7 +1962,7 @@ describe('OC.SetupChecks tests', function() {
19191962 {
19201963 'X-XSS-Protection' : '1; mode=block' ,
19211964 'X-Content-Type-Options' : 'nosniff' ,
1922- 'X-Robots-Tag' : 'none ' ,
1965+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
19231966 'X-Frame-Options' : 'SAMEORIGIN' ,
19241967 'X-Permitted-Cross-Domain-Policies' : 'none' ,
19251968 'Referrer-Policy' : 'no-referrer' ,
@@ -1965,7 +2008,7 @@ describe('OC.SetupChecks tests', function() {
19652008 {
19662009 'X-XSS-Protection' : '1; mode=block' ,
19672010 'X-Content-Type-Options' : 'nosniff' ,
1968- 'X-Robots-Tag' : 'none ' ,
2011+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
19692012 'X-Frame-Options' : 'SAMEORIGIN' ,
19702013 'X-Permitted-Cross-Domain-Policies' : 'none' ,
19712014 'Referrer-Policy' : 'no-referrer' ,
@@ -1990,7 +2033,7 @@ describe('OC.SetupChecks tests', function() {
19902033 'Strict-Transport-Security' : 'max-age=15551999' ,
19912034 'X-XSS-Protection' : '1; mode=block' ,
19922035 'X-Content-Type-Options' : 'nosniff' ,
1993- 'X-Robots-Tag' : 'none ' ,
2036+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
19942037 'X-Frame-Options' : 'SAMEORIGIN' ,
19952038 'X-Permitted-Cross-Domain-Policies' : 'none' ,
19962039 'Referrer-Policy' : 'no-referrer' ,
@@ -2015,7 +2058,7 @@ describe('OC.SetupChecks tests', function() {
20152058 'Strict-Transport-Security' : 'iAmABogusHeader342' ,
20162059 'X-XSS-Protection' : '1; mode=block' ,
20172060 'X-Content-Type-Options' : 'nosniff' ,
2018- 'X-Robots-Tag' : 'none ' ,
2061+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
20192062 'X-Frame-Options' : 'SAMEORIGIN' ,
20202063 'X-Permitted-Cross-Domain-Policies' : 'none' ,
20212064 'Referrer-Policy' : 'no-referrer' ,
@@ -2039,7 +2082,7 @@ describe('OC.SetupChecks tests', function() {
20392082 'Strict-Transport-Security' : 'max-age=15768000' ,
20402083 'X-XSS-Protection' : '1; mode=block' ,
20412084 'X-Content-Type-Options' : 'nosniff' ,
2042- 'X-Robots-Tag' : 'none ' ,
2085+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
20432086 'X-Frame-Options' : 'SAMEORIGIN' ,
20442087 'X-Permitted-Cross-Domain-Policies' : 'none' ,
20452088 'Referrer-Policy' : 'no-referrer' ,
@@ -2059,7 +2102,7 @@ describe('OC.SetupChecks tests', function() {
20592102 'Strict-Transport-Security' : 'max-age=99999999' ,
20602103 'X-XSS-Protection' : '1; mode=block' ,
20612104 'X-Content-Type-Options' : 'nosniff' ,
2062- 'X-Robots-Tag' : 'none ' ,
2105+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
20632106 'X-Frame-Options' : 'SAMEORIGIN' ,
20642107 'X-Permitted-Cross-Domain-Policies' : 'none' ,
20652108 'Referrer-Policy' : 'no-referrer' ,
@@ -2079,7 +2122,7 @@ describe('OC.SetupChecks tests', function() {
20792122 'Strict-Transport-Security' : 'max-age=99999999; includeSubDomains' ,
20802123 'X-XSS-Protection' : '1; mode=block' ,
20812124 'X-Content-Type-Options' : 'nosniff' ,
2082- 'X-Robots-Tag' : 'none ' ,
2125+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
20832126 'X-Frame-Options' : 'SAMEORIGIN' ,
20842127 'X-Permitted-Cross-Domain-Policies' : 'none' ,
20852128 'Referrer-Policy' : 'no-referrer' ,
@@ -2099,7 +2142,7 @@ describe('OC.SetupChecks tests', function() {
20992142 'Strict-Transport-Security' : 'max-age=99999999; preload; includeSubDomains' ,
21002143 'X-XSS-Protection' : '1; mode=block' ,
21012144 'X-Content-Type-Options' : 'nosniff' ,
2102- 'X-Robots-Tag' : 'none ' ,
2145+ 'X-Robots-Tag' : 'noindex, nofollow ' ,
21032146 'X-Frame-Options' : 'SAMEORIGIN' ,
21042147 'X-Permitted-Cross-Domain-Policies' : 'none' ,
21052148 'Referrer-Policy' : 'no-referrer' ,
0 commit comments