Skip to content

robots.txt is not valid #2891

Description

@MaxwellCohen

Describe the bug

I ran a Pagespeed Insights Lighthouse test on a random npmx page, and it reported that the robots.txt is malformed. This allows bots not specifically banned to scan pages they should not be able to and verify it by seeing pages that should be disallowed are currently indexed by bots.

For example, a package code page like: https://npmx.dev/package-code/srilanka-api/v/1.0.6 is currently indexed by Google, and according to manual testing from robots.txt Validator and Testing Tool, it is allowed by non-ai crawlers like Google Bot even though it should be banned according to line

Disallow: /package-code/

The fix is adding the following code to the top of the robots.txt

User-agent: *

Additional context

No response

Logs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending triageNew issue waiting for initial maintainer triage

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions