matrix-org / matrix-org/matrix-bifrost

the scheme and host of the uri to join a MUC should be case insensitive according to standards

Open
#249 1 comment 7 reactions 0 assignees View on GitHub
T-Defect
Dominant language
TypeScript
Stars
187
Forks
38
PR merge metrics
No merged PRs in 30d

Description

the scheme and host are case-insensitive and therefore should be normalized to lowercase

**Describe the bug**
- i can't join some rooms on matrix.org, need to create a new room alias address, but it doesn't update automatically in the bridge

**To Reproduce**
Steps to reproduce the behavior:
1. Add a new room on conversations xmpp client using: #**N**extcloud#matrix.org@matrix.org
2. check room details and see i join #**n**extcloud#matrix.org@matrix.org
3. it's a different room with a mixid in lowercase

**Expected behavior**
I expect to see the room i want to join which should be #**N**extcloud#matrix.org@matrix.org

**Smartphone (please complete the following information):**
- OS: Android
- Browser Conversations

**Additional context**
```
RFC 3986 states:

the scheme and host are case-insensitive and therefore should be normalized to lowercase. For example, the URI is equivalent to . The other generic syntax components are assumed to be case-sensitive unless specifically defined otherwise by the scheme

RFC 2616 defines the following comparison rule for the HTTP scheme:

When comparing two URIs to decide if they match or not, a client SHOULD use a case-sensitive octet-by-octet comparison of the entire URIs, with these exceptions:

However, RFC 7230 locks it down further by stating:

The scheme and host are case-insensitive and normally provided in lowercase; all other components are compared in a case-sensitive manner.

Those rules typically apply to client side comparisons. There are no rules specifically geared for server side comparisons. Once a server breaks up a URI into its components, it should treat them according to the same rules, but I don't see that enforced in the RFCs. Some web servers, like Apache, do follow the rules. IIS doesn't, for compatibility with Windows' case-insensitive file system.
```
https://stackoverflow.com/a/26196170

Contributor guide

Open the contributing guide

Research direction

Start by tracing how the bridge parses and constructs MUC room URIs for XMPP and Matrix aliases, then reproduce the mixed-case example from the issue. Verify that the scheme and host are normalized without changing the room alias, and confirm that the requested room and the resulting joined room match.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.