[Channel] Resolve localhost equivalents when matching channel by hostname#18726
Merged
GSadee merged 1 commit intoSylius:2.2from Jan 19, 2026
Merged
Conversation
…name When resolving channels by hostname, localhost, 127.0.0.1 and ::1 are now treated as equivalents. If no channel is found for the exact hostname but the hostname is one of these localhost variants, the resolver will try the other variants. This improves local development experience when browser URL and fixtures use different formats (e.g. localhost in fixtures but 127.0.0.1 in browser).
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
❌ Preview Environment deleted from BunnyshellAvailable commands:
|
GSadee
approved these changes
Jan 19, 2026
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.
When resolving channels by hostname, localhost, 127.0.0.1 and ::1 are now treated as equivalents. If no channel is found for the exact hostname but the hostname is one of these localhost variants, the resolver will try the other variants.
Previously, Sylius did exact string comparison when matching channels by hostname. This meant that a channel configured with
localhostwould not be matched when accessing via127.0.0.1, and vice versa. This caused friction in local development when browser URL and fixtures used different hostname formats.The fix adds fallback logic in
HostnameBasedRequestResolverthat checks other localhost equivalents when: