Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Next.js][Multi-site] Updated site resolver to prefer more specific hostname matches #1306

Merged
merged 2 commits into from
Jan 27, 2023

Conversation

ambrauer
Copy link
Contributor

Description / Motivation

More specific hostname matches should take precedence over a less specific match (i.e. with wildcards). For example, given the following site info array:

[
    {
        name: "foo",
        hostname: "*"
    },
    {
        name: "bar",
        hostname: "*.app.net"
     },
     {
        name: "baz",
        hostname: "baz.app.net"
     },
]

it would resolve the following sites for given hostname:

"foo.net" > "foo"
"bar.app.net" > "bar"
"baz.app.net" > "baz"

Testing Details

Unit tests added

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@ambrauer ambrauer requested a review from a team January 26, 2023 19:32
Copy link
Contributor

@illiakovalenko illiakovalenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, one case to verify below

@ambrauer ambrauer merged commit 313d73f into dev Jan 27, 2023
@ambrauer ambrauer deleted the feature/570121 branch January 27, 2023 14:48
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.

2 participants