Skip to content

Allow freesite to set robots, googlebot and referrer=no-referrer meta tag#1077

Merged
ArneBab merged 2 commits into
hyphanet:nextfrom
torusrxxx:meta
Jun 22, 2025
Merged

Allow freesite to set robots, googlebot and referrer=no-referrer meta tag#1077
ArneBab merged 2 commits into
hyphanet:nextfrom
torusrxxx:meta

Conversation

@torusrxxx

Copy link
Copy Markdown
Contributor

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.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, ",");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ArneBab ArneBab merged commit add1b30 into hyphanet:next Jun 22, 2025
1 check passed
@torusrxxx torusrxxx deleted the meta branch June 23, 2025 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants