Skip to content

Support wild cards in allowed external redirect hosts#7444

Merged
labkey-adam merged 7 commits intodevelopfrom
fb_wild_cards
Feb 25, 2026
Merged

Support wild cards in allowed external redirect hosts#7444
labkey-adam merged 7 commits intodevelopfrom
fb_wild_cards

Conversation

@labkey-adam
Copy link
Contributor

@labkey-adam labkey-adam commented Feb 21, 2026

Rationale

Supporting wild cards in allowed external redirect hosts provides convenience when allowing a large number of subdomains is desired. Also, reconcile redirect for consistency and safety. https://github.com/LabKey/internal-issues/issues/852

// This wild-card pattern matches the host if 1) they have the same number of dots and 2) the host ends with
// the portion of the pattern after the wild card.
int expectedDotCount = StringUtils.countMatches(allowedHost, '.');
ret = (dotCount == expectedDotCount && Strings.CI.endsWith(host, allowedHost.substring(2)));
Copy link
Contributor

Choose a reason for hiding this comment

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

hmmm, tricky.

@labkey-adam labkey-adam merged commit 7d500be into develop Feb 25, 2026
11 checks passed
@labkey-adam labkey-adam deleted the fb_wild_cards branch February 25, 2026 18:45
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