Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS blocks https://mozilla.org/.well-known/matrix/client #12311

Closed
ara4n opened this issue Feb 10, 2020 · 12 comments
Closed

CORS blocks https://mozilla.org/.well-known/matrix/client #12311

ara4n opened this issue Feb 10, 2020 · 12 comments

Comments

@ara4n
Copy link
Member

ara4n commented Feb 10, 2020

If you try to discover a custom server in Riot/Desktop (e.g. by entering @foo:mozilla.org as your mxid), it fails miserably with:

Access to XMLHttpRequest at 'https://mozilla.org/.well-known/matrix/client' from origin 'vector://vector' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
@t3chguy
Copy link
Member

t3chguy commented Feb 11, 2020

That doesn't look like CSP

@t3chguy
Copy link
Member

t3chguy commented Feb 11, 2020

especially as riot/desktop official builds don't have the CSP changes yet

@jryans jryans changed the title CSP stops .well-known/matrix/client from working in Riot/Desktop CORS blocks https://mozilla.org/.well-known/matrix/client Feb 11, 2020
@jryans
Copy link
Collaborator

jryans commented Feb 11, 2020

Instead of CSP, it looks like this is a CORS issue on Mozilla's side:

So, this seems to be something Mozilla would have to correct on their side.

@Twi1ightSparkle
Copy link

https://mozilla.org/.well-known/matrix/server needs the CORS too while you're at it

@ara4n
Copy link
Member Author

ara4n commented Feb 11, 2020

That doesn't look like CSP

oops, sorry for misdiagnosing.

https://mozilla.org/.well-known/matrix/server needs the CORS too while you're at it

Strictly speaking, the /server URI shouldn't need CORS, as clients don't check the server URI.

@pmac
Copy link

pmac commented Feb 11, 2020

hmm... so https://www.mozilla.org/.well-known/matrix/client is responding with the proper CORS header, but https://mozilla.org/.well-known/matrix/client isn't when it sends the 302. Is that the problem? I'll see about getting the redirect to send the header. Though it might be easier for the team that owns the redirect to just host the file as well.

@pmac
Copy link

pmac commented Feb 11, 2020

@jryans
Copy link
Collaborator

jryans commented Feb 11, 2020

hmm... so https://www.mozilla.org/.well-known/matrix/client is responding with the proper CORS header, but https://mozilla.org/.well-known/matrix/client isn't when it sends the 302. Is that the problem? I'll see about getting the redirect to send the header. Though it might be easier for the team that owns the redirect to just host the file as well.

Yes, either the redirect needs to also set the access-control-allow-origin: * or serve the file directly (also with access-control-allow-origin: * set).

@jryans
Copy link
Collaborator

jryans commented Feb 11, 2020

Since we can't do anything about this on the Riot side and there's an issue tracking it for Mozilla's infrastructure, let's close this one.

@jryans jryans closed this as completed Feb 11, 2020
@pmac
Copy link

pmac commented Feb 11, 2020

Got an update in the bug that this should now be fixed. I do see the proper header on the redirect. Can someone confirm that it works now?

@aaronraimist
Copy link
Collaborator

Works for me

@ara4n
Copy link
Member Author

ara4n commented Feb 11, 2020

yup, confirmed fixed - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants