Allow freesite to set robots, googlebot and referrer=no-referrer meta tag#1077
Conversation
| hn.put("content", content); | ||
| } else if (name.equalsIgnoreCase("referrer")) { | ||
| hn.put("name", name); | ||
| hn.put("content", "no-referrer"); // Only no-referrer is allowed in freesites for privacy |
There was a problem hiding this comment.
What privacy exactly? This is about what Referer header is sent upon navigation, but considering the destination would always be the node that rendered this page in the first place (external links are bounced through an intermediate page), there's nothing to hide.
Also the implementation does not match the comment - this does not "only allow" no-referrer, but forces no-referrer whenever any value is set (but does not enforce it when no value is set).
I would suggest dropping support for this metadata name.
| hn.put("name", name); | ||
| hn.put("content", "no-referrer"); // Only no-referrer is allowed in freesites for privacy | ||
| } else if (name.equalsIgnoreCase("robots") || name.equalsIgnoreCase("googlebot")) { | ||
| StringTokenizer tokenizer = new StringTokenizer(content, ","); |
There was a problem hiding this comment.
From the StringTokenizer Javadoc:
StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead.
Freesites should be able to set the robots tag to tell spiders on freenet to stop publishing them. Invalid robots value is filtered.
Freesites can also set referrer, and no-referrer is the only value supported.