X-Robots-Tag shouldn't be a literal string check

First off, this isn’t a repeat of: The "X-Robots-Tag" HTTP header is not set to "noindex, nofollow"

Second, the error is the same as that other ticket but that’s not my point:
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.

My point is that NC should check that these are within the string but not an explicit what-seems-to-be-a-hard-coded string. NC should only care that these are somewhere in the string, right?

#
# Showing Error First
#
$ grep X-Ro nextcloud.conf
add_header X-Robots-Tag                      "none" always;
$ systemctl restart nginx
$ curl -v https://$url 2>&1 | grep x-rob
< x-robots-tag: none
#
# Error  exists in NC
#
# Check error goes away
#
$ grep X-Ro nextcloud.conf
add_header X-Robots-Tag                      "noindex, nofollow" always;
$ systemctl restart nginx
$ curl -v https://$url 2>&1 | grep x-rob
< x-robots-tag: noindex, nofollow
#
# Error goes away so that's a good thing.
#
# Swap order; error returns
#
$ grep X-Ro nextcloud.conf
add_header X-Robots-Tag                      "nofollow, noindex" always;
$ systemctl restart nginx
$ curl -v https://$url 2>&1 | grep x-rob
< x-robots-tag: nofollow, noindex
#
# Error exists again. WTF?
#
# Add a more strict requirement
#
$ grep X-Ro nextcloud.conf
add_header X-Robots-Tag                      "noindex, nofollow, noai" always;
$ systemctl restart nginx
$ curl -v https://$url 2>&1| grep x-rob
< x-robots-tag: noindex, nofollow, noai
#
# Error still exists
#

Order shouldn’t matter. And adding other options shouldn’t matter either.

At least that’s my opinion. :smiley:

Thanks!

I fully agree… but at the moment current implementation works as it does - feel free to push a PR:

1 Like

This topic was automatically closed after 10 days. New replies are no longer allowed.