Skip to content

parseRobotsTxt keeps a negative or non-finite Crawl-delay #1145

Closed

Description

@nc9

Since #1079 and #996, parseRobotsTxt keeps a user-agent group whose only record is Crawl-delay, and it stores whatever Number.parseFloat returns:

  • User-agent: * then Crawl-delay: -1 stores crawlDelay: -1
  • Crawl-delay: 1e999 stores Infinity, which serializes as null in a published report

A strict consumer rejects the whole report on these: the cloud's report schema returned a 400 for the publish until repo#3348's bump started dropping the value. A negative or non-finite delay is not a delay, so the parser should not keep it.

Acceptance Criteria

  • parseRobotsTxt stores crawlDelay only when it is finite and >= 0. Any other value is ignored like an unparseable delay, so the group is kept only when it has another record.
  • Tests cover -1, 1e999, NaN, Infinity, 0 and 2.5.
  • The robots-txt rule's crawl-delay warning behaves the same for valid delays.

Activity

  1. added
    bug
    size: XS
    rules
    on Oct 26, 2026
  2. nc9 commented on Oct 26, 2026

    @nc9
    ContributorAuthor

    Fixed in #1147 (main c09d949): a negative or non-finite Crawl-delay is ignored. Ships in v0.0.134.

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

    bugrulessize: XS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions