Skip to content

Conversation

@devonh
Copy link
Member

@devonh devonh commented Nov 14, 2025

Fixes #19184

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

@devonh devonh requested a review from a team as a code owner November 14, 2025 21:34
Copy link
Member

@sandhose sandhose left a comment

Choose a reason for hiding this comment

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

Good overall, but maybe we should just roll back to the old way we did that instead?


@property
def _metadata_url(self) -> str:
return str(
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we wouldn't be better off just doing what we were doing before? e.g.

    @property
    def _metadata_url(self) -> str:
        return f"{str(self._config.endpoint).rstrip('/')}/.well-known/openid-configuration"

    @property
    def _introspection_endpoint(self) -> str:
        return f"{str(self._config.endpoint).rstrip('/')}/oauth2/introspect"

alternatively we could probably use urllib.parse.urljoin, but that might also have weird consequences depending on the trailing slash:

>>> import urllib.parse
>>> urllib.parse.urljoin("https://example.com", ".well-known/openid-configuration")
'https://example.com/.well-known/openid-configuration'
>>> urllib.parse.urljoin("https://example.com/foo", ".well-known/openid-configuration")
'https://example.com/.well-known/openid-configuration'
>>> urllib.parse.urljoin("https://example.com/foo/", ".well-known/openid-configuration")
'https://example.com/foo/.well-known/openid-configuration'

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm yeah the old way seems a lot simpler.
Not sure why it was drastically changed in the first place.

I say we go back to the old way.

@devonh devonh merged commit bc42899 into develop Nov 18, 2025
78 of 80 checks passed
@devonh devonh deleted the devon/mas-subpath branch November 18, 2025 19:02
devonh added a commit that referenced this pull request Nov 18, 2025
Fixes #19184

### Pull Request Checklist

<!-- Please read
https://element-hq.github.io/synapse/latest/development/contributing_guide.html
before submitting your pull request -->

* [X] Pull request is based on the develop branch
* [X] Pull request includes a [changelog
file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog).
The entry should:
- Be a short description of your change which makes sense to users.
"Fixed a bug that prevented receiving messages from other servers."
instead of "Moved X method from `EventStore` to `EventWorkerStore`.".
  - Use markdown where necessary, mostly for `code blocks`.
  - End with either a period (.) or an exclamation mark (!).
  - Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by
@github_username." or "Contributed by [Your Name]." to the end of the
entry.
* [X] [Code
style](https://element-hq.github.io/synapse/latest/code_style.html) is
correct (run the
[linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Nov 18, 2025
Fixes a bug introduced in v1.142.0 preventing subpaths in MAS endpoints
from working.

Link: element-hq/synapse#19184
Link: element-hq/synapse#19186
Signed-off-by: Petr Vaněk <[email protected]>
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.

Synapse v1.142.0 regressed in its support for Matrix Authentication Service hosted under a subpath

3 participants