Repository navigation
fix: stop advertising the RSL license on plain allowed responses - #30
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR stops the SDK from sending the RSL license
Linkheader on plain allowed responses, sohandleRequest()advertises the license only when it treats a request as a bot's: on theOBSERVEmissing-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:LinkbeforeLinkafterDISABLED)OBSERVEsignal (bot without a token)WWW-Authenticateand theX-RSL-Status/X-RSL-Reasonsignal headers are unchanged.Key Changes
ResponseBuilder::buildAllowResult()returns anAllowResultwith no headers. Its signature is unchanged ($requestUrlis now unused), so this ships as a minor release.buildSignalResult()andbuildBlockResult()are untouched.Link; the signal test pins the exact header set; a data-provider test checks that every block reason carriesLink, including 503server_errorand string reasons; newhandleRequest()tests cover theENFORCEmissing-token block, an invalid token and an emptyLicensetoken.