Skip to content

Conversation

@itslenny
Copy link
Contributor

@itslenny itslenny commented Oct 6, 2025

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Many objects are indexed by web crawlers as there are no x-robot-tag headers

What is the new behavior?

  • Add default x-robots-tag: none header to prevent search engines from indexing / following
  • Add ability to specify custom x-robots-tag header when uploading objects
  • Use x-robots-tag value specified in object metadata in headers when serving files
  • Fix eslint warnings in edited files

Additional context

https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Robots-Tag

@coveralls
Copy link

coveralls commented Oct 6, 2025

Pull Request Test Coverage Report for Build 19315179516

Details

  • 174 of 245 (71.02%) changed or added relevant lines in 13 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 77.743%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/http/routes/object/getPublicObject.ts 1 3 33.33%
src/http/routes/object/getObject.ts 3 7 42.86%
src/storage/validators/x-robots-tag.ts 123 188 65.43%
Totals Coverage Status
Change from base Build 19309174116: -0.04%
Covered Lines: 24773
Relevant Lines: 31542

💛 - Coveralls

@itslenny itslenny force-pushed the fix/add-robots-header branch 2 times, most recently from 5970c63 to 98440df Compare October 7, 2025 22:51
@itslenny itslenny force-pushed the fix/add-robots-header branch from 7d741f8 to a019e9b Compare October 9, 2025 17:59
@itslenny itslenny requested a review from fenos October 9, 2025 18:02
@itslenny itslenny force-pushed the fix/add-robots-header branch from a019e9b to c5362a6 Compare November 12, 2025 23:27
@itslenny itslenny force-pushed the fix/add-robots-header branch from c5362a6 to 2f54df7 Compare November 12, 2025 23:28
@itslenny itslenny merged commit 174f294 into master Nov 12, 2025
2 checks passed
@itslenny itslenny deleted the fix/add-robots-header branch November 12, 2025 23:37
@@ -0,0 +1,188 @@
import { ERRORS } from '@internal/errors'

const SIMPLE_RULES = [

Choose a reason for hiding this comment

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

Ignore me if this is already discussed but otherwise wanted let you know that nocache/noarchive seem still in use by some (i.e. Bing) and so excluding them can fail normally valid requests in validation

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.

5 participants