EscolaLMS/H5P

library update not working due to CORS

Closed this issue · 0 comments

Steps to reproduce :

  1. https://admin-stage.escolalms.com/#/courses/h5ps/new
  2. click update on any content that is able to update

image

3. error 403 even when token is sent to backend as query param

image

Access to fetch at 'https://api-stage.escolalms.com/api/hh5p/library-install?_token=XYZ&id=H5P.SingleChoiceSet' from origin 'https://admin-stage.escolalms.com' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'.

Fix is responding from Laravel CORS

instead of Response Headers

access-control-allow-origin: *

is should be

access-control-allow-origin: requested.domain.com