Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

CORS Blocking with /topictree endpoint #139

Open
jb-1980 opened this issue May 22, 2019 · 3 comments
Open

CORS Blocking with /topictree endpoint #139

jb-1980 opened this issue May 22, 2019 · 3 comments

Comments

@jb-1980
Copy link
Contributor

jb-1980 commented May 22, 2019

Last time (maybe a month ago) I tried my app at https://jb-1980.github.io/khan-video-linker/ was working fine, but as I am trying to use it this morning I am getting an error indicating the data is blocked because of CORS. Did you recently update the /topictree endpoint?

If we visit the url to fetch exercises, http://www.khanacademy.org/api/v1/exercises, this is what I see in the response headers:

Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
...

Looking at the response headers for https://www.khanacademy.org/api/v1/topictree?kind=Video we see:

content-encoding: gzip
content-type: text/html;charset=utf-8
date: Wed, 22 May 2019 13:19:50 GMT
server: Jetty(9.4.z-SNAPSHOT)
status: 200
vary: Accept-Encoding
via: 1.1 google

There is no Access-Control-Allow-Origin header. I can't say that there was, but I can say that my app was working last time I needed it and now it isn't. And that setting Allow-Control-Allow-Origin on the server is the way to resolve the CORS issue.

So the only way I can see for me to resolve the issue is if you can fix the headers on the server, or I can set up a proxy server. But setting up a proxy server seems like overkill for this project.

So pretty please, can you add the appropriate headers? I would be ever so grateful.

@tomyedwab
Copy link
Member

Thank you for reporting this. We are tracking this as a bug and will update this ticket when it is fixed.

@jb-1980
Copy link
Contributor Author

jb-1980 commented Jul 19, 2019

Hello, any update on this? I am currently using a proxy server. But it is in a free sandbox that takes 30s to spin up, and being able to access this with fetch from the browser would be really nice.

@bsmarsh333
Copy link

Also experiencing the same problem. Impacting our teachers and students.

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

No branches or pull requests

3 participants