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

If h5p js file is not found, it does not fail clearly #34

Open
matthewhilton opened this issue Apr 17, 2023 · 0 comments
Open

If h5p js file is not found, it does not fail clearly #34

matthewhilton opened this issue Apr 17, 2023 · 0 comments

Comments

@matthewhilton
Copy link

matthewhilton commented Apr 17, 2023

The proxying method of our fork uses curl:

// The proxy will pass content back from pluginfile.php
$url = new moodle_url('/pluginfile.php/'.ltrim($relativepath, '/'));
$curl->get($url->out());

However it is possible for the curl object to return something that is not a file. E.g. an error string:

https://github.com/moodle/moodle/blob/8fc1486d36ad7ed5f44deddd80bd6b19a8410e06/lib/filelib.php#L3934-L3940

Which results in the browser getting a HTTP 200 response, but no JS (since its just an error string) - this means you will get various errors about XYZ is not defined or cannot find constructor, since the JS didn't load properly.

But when you look in the browser console, the JS has a HTTP 200 status which is deceiving.

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

No branches or pull requests

1 participant