Repository navigation
Anchor the well-known rewrite rules - #3902
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.
Fixes #
Proposed changes:
/.well-known/webfinger,/.well-known/nodeinfoand/.well-known/oauth-authorization-serverwere not anchored, so they matched every path starting with that prefix. The plugin answered/.well-known/oauth-authorization-server/wp-api/indieauth/1.0with its own metadata, but under RFC 8414 §3.1 that URL belongs to an issuer with the path/wp-api/indieauth/1.0, here the IndieAuth plugin. Because of this, indieauth.rocks test S117 fails.home_url()without a path, so the bare path is all the plugin owns./.well-known/nodeinfo/2.0or/.well-known/webfinger/fooreturned the discovery document or the WebFinger response before, and now fall through to WordPress (404). Nothing in the plugin links to them, the NodeInfo discovery document points to the REST URLs, and WebFinger uses?resource=, which is not part of the rewrite match.Other information:
Testing instructions:
npm run env-test -- --filter Test_Router./.well-known/oauth-authorization-server, it should return the ActivityPub metadata./.well-known/oauth-authorization-server/wp-api/indieauth/1.0, it should return a 404 (or the IndieAuth metadata, if the plugin is active and registers that path)./.well-known/webfinger?resource=acct:admin@your-siteand/.well-known/nodeinfo, both should work as before.Changelog entry
Changelog Entry Details
Significance
Type
Message