Skip to content

fix: stop advertising the RSL license on plain allowed responses - #30

Merged
tomasstark merged 2 commits into
mainfrom
fix/no-license-link-on-allow
Oct 13, 2026
Merged

tomasstark merged 2 commits into
mainfrom
fix/no-license-link-on-allow

Conversation

@tomasstark

@tomasstark tomasstark commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

This PR stops the SDK from sending the RSL license Link header on plain allowed responses, so handleRequest() advertises the license only when it treats a request as a bot's: on the OBSERVE missing-token signal and on blocked responses. It also prepares the v2.1.0 release.

Context

#15 added Link: <…/license.xml>; rel="license" to every allowed response, following the RSL Crawler Authorization Protocol's guidance for served responses. In practice that put the header on every page view by a person as well, and it diverged from the TypeScript SDK, which never sends it on its allow path. The team decided the header should go to crawlers only, and a plain allowed response gives no reliable sign that a crawler made the request. After this change the PHP SDK behaves the same as the TypeScript SDK:

Response Link before Link after
Plain allow (non-bot, valid token, DISABLED) yes no
OBSERVE signal (bot without a token) yes yes
Block (401 / 403 / 503) yes yes

WWW-Authenticate and the X-RSL-Status / X-RSL-Reason signal headers are unchanged.

Key Changes

  • ResponseBuilder::buildAllowResult() returns an AllowResult with no headers. Its signature is unchanged ($requestUrl is now unused), so this ships as a minor release.
  • buildSignalResult() and buildBlockResult() are untouched.
  • Tests: the allow-path tests now assert there is no Link; the signal test pins the exact header set; a data-provider test checks that every block reason carries Link, including 503 server_error and string reasons; new handleRequest() tests cover the ENFORCE missing-token block, an invalid token and an empty License token.
  • README notes where the license is advertised.
  • Version bumped to v2.1.0, with a CHANGELOG entry.

@tomasstark
tomasstark merged commit f91e259 into main Oct 13, 2026
5 checks passed
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.

1 participant