Skip to content

Improve domain splitting for "Hosted by" header#371

Open
luelista wants to merge 1 commit into
matrix-org:mainfrom
luelista:fix-hosted-by-header
Open

Improve domain splitting for "Hosted by" header#371
luelista wants to merge 1 commit into
matrix-org:mainfrom
luelista:fix-hosted-by-header

Conversation

@luelista

Copy link
Copy Markdown

If a preferred web instance is set, an additional "Hosted by example.com" label is shown. This label is supposed to display only the main domain without subdomains, so if "element.example.com" is set, we show "Hosted by example.com". However, the logic doesn't do that at all (in only works by accident for domains where the subdomain is exactly one character longer than the TLD, matching the quite common chat.something.org or app.something.io structure).

image

The proposed code is still somewhat flawed as it wouldn't work properly for e.g. a chat.example.co.uk domain (displaying Hosted on co.uk), but at least it works for the currently trusted instances.

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