Conversation
…if request doesn't match the configured hosts.
|
Can we get this reviewed? |
AndyButland
added a commit
that referenced
this pull request
Apr 4, 2025
…if request doesn't match the configured hosts. (#18820)
Contributor
Author
|
Cherry-picked into |
This was referenced Sep 30, 2025
This was referenced Dec 9, 2025
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.
Prerequisites
Resolves: #16816
Description
I was able to replicate the reported issue with the provided setup. Digging in it seemed that the issue is in the set of candidates we get in our implementation of
IEndpointSelectorPolicy(EagerMatcherPolicy). This receives a set of candidates that match the route - so in the scenario from the provided setup code we have two, one for the custom controller and one for Umbraco's default match by slug.I perhaps would have expected that this set of candidates would already have filtered out the one provided by the attribute routed custom controllers, but it seems it doesn't - it's included as the configured route matches.
So I've added a check to ensure that if we have an attribute routed
IVirtualPageController, we look for aHostAttributeand if found, that the configured hosts include the host from the current request.Testing
Setup using the provided test project and verify that the page on site 2 that shouldn't be affected by the attribute routed custom controller renders it's content.