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

Enable cross origin resource sharing? #76

Open
ttaylor-st opened this issue May 10, 2024 · 2 comments · May be fixed by #80
Open

Enable cross origin resource sharing? #76

ttaylor-st opened this issue May 10, 2024 · 2 comments · May be fixed by #80

Comments

@ttaylor-st
Copy link

A while ago I was planning creating a web-based client for Discuit, but as Discuit doesn't set any CORS headers, I ran into the following error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://discuit.net/api/_initial. 
(Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Are there any reasons why CORS headers aren't currently set? I think enabling CORS would be great for third-party developers :)

@previnder
Copy link
Member

No any particular reason other than no one's requested it before. And I don't think there would be an issue with allowing any origin to have to access to the API.

@ttaylor-st ttaylor-st linked a pull request May 15, 2024 that will close this issue
@ttaylor-st
Copy link
Author

Fhis isn't directly related to CORS (I don't think?), but thought I'd bring it up here anyway, it's quite important for any web-based clients.

Issue being the Set-Cookie header and cookies set are inaccessible from JavaScript, meaning that a web client on a different origin wouldn't be able to access the SID which is set in a cookie. I believe the cause of this is that the SID and CSRF Token cookies are set as HTTP Only, but I'm going to do a bit of experimentation with this tomorrow (well... today actually but y'know), just leaving this here Incase anyone has anything to add

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 a pull request may close this issue.

2 participants