-
-
Notifications
You must be signed in to change notification settings - Fork 830
SlidingSync does not work when hosted on path other than / (root) #12658
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec specifies the path as an absolute, so the MSC would need clarifying to allow this
This is our https://example.com/.well-known/matrix/client {
"org.matrix.msc3575.proxy": {
"url": "https://matrix.exampe.com/sliding-sync"
}
} But element is trying to load https://matrix.exampe.com/client/server.json which fails because of the constructur behaviour. |
I can't follow you. |
I'm rather confused.
I don't see any reference to an object called What am I missing? |
I was not talking about the MSC, but the implementation in element and the react sdk. They are loading the server.json to get the URL of the sync service. So I thought this is the way to do it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this endpoint isn't documented anywhere, I don't think the react-sdk should be supporting it at all.
It is a healthcheck endpoint for the sliding sync proxy for whilst the implementation on both sides is unstable, this check was added by @kegsay originally |
When sliding-sync is hostet on the same domain, but in a sub path, the url resolution will fail.
Example:
base domain: matrix.example.com
sliding-sync: matrix.example.com/sliding-sync
the URL constructur
new URL("/client/server.json", proxyUrl)
will create the url matrix.example.com/client/server.json and not as required matrix.example.com/sliding-sync/client/server.json.Removing the leading slash from the will solve the issue as per the documentation https://developer.mozilla.org/en-US/docs/Web/API/URL/URL